Kendo UI Grid - How to catch an event triggered by a filter

Can I catch an event triggered by a filter event? Using this method, can I take the returned string / rows after filtering?

+5
source share
2 answers

Like Kendo in the API reference: "The data source change event is fired when the data source is populated from a JavaScript array or remote service, the data element is inserted, updated or deleted, data elements are unloaded, sorted, filtered or grouped."

In any case, you cannot determine if it was a filter or another read type event. If you need this, you should check the filter configuration in the gridSource data file for any changes.

The returned rows are in the items property of the argument of the change function. The code:

$("#grid").kendoGrid({ dataSource: { change: function(e) {console.log(e.items);}, }, 

Example: http://dojo.telerik.com/iPEko

API reference for data source change event.

API reference for the dataSource filter method.

+3
source

The answer of Yaroslav did not help me. I tried to select the first entry in the kendo grid after the filter.

I solved this by attaching to a grid-related data event.

 $("#grid").kendoGrid({ columns: [ { field: "name" }, { field: "age" } ], dataSource: [ { name: "Jane Doe", age: 30 }, { name: "John Doe", age: 33 } ], dataBound: function(e) { //your databound event here } }); 

In addition, you can use the view method to get the displayed results after filtering.

0
source

Source: https://habr.com/ru/post/1208410/


All Articles