Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145657 | Jul 2,2019 05:10 PM UTC | Jul 8,2019 12:30 PM UTC | ASP.NET Core - EJ 2 | 4 |
![]() |
Tags: DataGrid |
<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.
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.