Filter grid via JavaScript (not the UI)

I have a DataGrid that I would like the user to be able to filter the grid on one column only.

I don't want to use the filter controls built into the Grid component. Instead, I want to apply the filter via JavaScript - is this possible?

thanks
Richard

1 Reply

MS Manivel Sellamuthu Syncfusion Team April 16, 2020 09:42 AM UTC

Hi Richard, 

Greetings from Syncfusion support. 

Based on your query we suspect that you want to filter the grid column programmatically. For this you can use filterByColumn method of the Grid. Please refer the below code example and documentation for more information. 


For example to filter a value in OrderID column in the Grid 

            var grid = document.getElementById("Grid").ej2_instances[0]; 
                grid.filterByColumn('OrderID'"equal"10248)); 

Please let us know if you need any further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon