Hi Buster,
We have checked your query and you can achieve your requirement by using grid.currentViewData in the actionComplete event of Grid component with requstType ‘filtering’. We have prepared a simple sample based on your requirement in which you can get the currently displayed records in the actionComplete event after filter action has completed. Please refer to the below code example , Documentation link and sample link.
[index.chtml]
|
<div>
@Html.EJS().Grid("Grid").DataSource(dataManager => { dataManager.Url("/Home/UrlDatasource").Adaptor("UrlAdaptor"); }).Columns(col =>
{
. . .
}).AllowPaging().AllowReordering().ActionComplete("complete").AllowFiltering(true).FilterSettings(filter => filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel)).AllowResizing(true).ShowColumnChooser(true).Toolbar(new List<string>() { "Search", "ColumnChooser" }).PageSettings(page => page.PageSize(10)).Render()
</div>
<script>
function complete(e) {
if (e.requestType == 'filtering') {
var grid = document.getElementsByClassName('e-grid')[0].ej2_instances[0]
console.log(grid.currentViewData); // you can make your calculations on this current view data
}
}
</script> |
Sample :
Regards,
Pavithra S.