We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Filter Event Handler

Hi,

I am looking for a way to trigger a function when filtering is applied on a grid so that I can change the dataSource of a chart? Is this possible and how would I achieve this.

Regards

1 Reply

PS Pavithra Subramaniyam Syncfusion Team February 27, 2019 12:03 PM UTC

Hi Rikard, 
 
Thanks for contacting syncfusion support. 
 
You can achieve your requirement by using the “actionComplete” event of Grid component with requestType as ‘filtering’. Please refer to the below code example and documentation link for more information. 
 
[index.cshtml] 
  <ejs-grid id="Grid" dataSource="ViewBag.datasource"  allowFiltering="true" actionComplete="actionComplete" " allowPaging="true"> 
            <e-grid-pagesettings pageCount="2"></e-grid-pagesettings> 
            <e-grid-columns> 
                <e-grid-column field="OrderID" headerText="Order ID" textAlign="Right" width="120"></e-grid-column> 
                .   .   . 
            </e-grid-columns> 
        </ejs-grid> 
 
<script> 
          function actionComplete(args) { 
              if (args.requestType === 'filtering') { 
                // you can do your requirement here 
            } 
        } 
</script> 
 
 
                              https://ej2.syncfusion.com/javascript/documentation/api/grid/filterEventArgs/  
 
Please contact us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon