<ejs-grid id="Grid" allowPaging="true" dataStateChange="dataStateChange" ...>
<e-data-manager url="/Home/UrlDataSource" adaptor="UrlAdaptor"></e-data-manager>
...
</ejs-grid>
$.ajax({ //Your AJAX call for external filtering
url: "/Home/ExternalFilter",
...
success: function (filterdata) {
var grid = document.getElementById("Grid").ej2_instances[0];
grid.dataSource = {result: JSON.parse(filterdata),count: JSON.parse(filterdata).length}; //Bind the external filter result as “result” and “count” pair to the dataSOurce property
}
});
function dataStateChange(args) { //this will be triggered when you perform actions in Grid after you bind the filtered data as result count pair
//In this "args" you will get the query params for the corresponding action.
//Use these params and form your ajax call to your external filter or any other action call
//Later bind that controller’s return result as a “result” and “count” pair.
}
|