Hi Ganga,
Thanks for using Syncfusion products.
We can achieve your requirement by using “
predicated” parameter ,in which we can get the predicate of the filtered records in
ActionComplete event of the grid.
We can get the filtered data by passing predicate value using
where method of the query as follows.
@(Html.EJ().Grid<object>("FlatGrid")
. . . .
.ClientSideEvents(eve=>{eve.ActionComplete("complete");})
)
<script type="text/javascript">
var origData, flag=0;
function complete(args)
{
if(flag==0)
origData = this.model.dataSource;
if (args.requestType == "filtering" && !ej.isNullOrUndefined(args.predicated)) {
this.model.dataSource = this._dataManager.executeLocal(this.model.query.where(args.predicated)).result;
flag++;
}
else {
this.model.dataSource = origData; //Retaining the original data while clear the filter
}
}
</script>
|
Please try the above snippet and let us know if you have any queries.
Regards,
Gowthami V.