Ag-grid Angular How to get click events on Header?

后端 未结 2 1828
无人共我
无人共我 2021-01-19 08:30

Is there any way to get notified of click events on ag-grid\'s header in Angular?

The -Component offers multiple events for cli

相关标签:
2条回答
  • 2021-01-19 08:58

    You could basically listen to the "sortChanged" event, that ag-grid provides when you click on the default header.

    0 讨论(0)
  • 2021-01-19 09:06

    I think this may be possible if you define the header component (see: Header Components). In your template for the header component you can create a div element (or any other container element) and define the (click) event handler. This worked for me:

    <div (click)='onHeaderClick($event)'>
      <p>Name</p>
    </div>
    

    (Of course you'd probably want to pass the header title in the parameters to the agInit() method, since you wouldn't want to create a separate header component for every header!)

    0 讨论(0)
提交回复
热议问题