Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo UI Grid - How to catch an event fired by filter

Can I catch an event fired by filter event? With this way, Can I take a returned row/rows after filtering?

like image 444
esquare Avatar asked Dec 05 '14 08:12

esquare


People also ask

How do you put a filter on a kendo grid?

With the Kendo UI grid you can enable filter row in its header by setting the grid's filterable->mode property to row.

What is Pageable in kendo grid?

kendo:grid-pageable-messagesThe text messages displayed in pager. Use this option to customize or localize the pager messages.

What is dataItem in kendo grid?

Returns the data item to which the specified table row is bound. The data item is a Kendo UI Model instance. When using the Grid's MVC wrapper, the Grid must be Ajax-bound for the dataItem() method to work.

How do I set the default filter in kendo grid?

Solution. On the dataBound event of the grid, find the filter dropdown and select() the desired default filter option. On the filter event of the Grid, if the filter is cleared, select the desired default filter option.


1 Answers

Like Kendo say in API reference: "The change event of the dataSource is fired when the data source is populated from a JavaScript array or a remote service, a data item is inserted, updated or removed, the data items are paged, sorted, filtered or grouped."

Anyway you can't detect if that was filter or other event of type "read" fired. If you need it, you have to check the filter configuration in grid dataSource for any changes.

Returned rows are in the items property of the change function argument. Code:

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

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

API Reference for dataSource change event.

API Reference for dataSource filter method.

like image 179
Jarosław Kończak Avatar answered Oct 05 '22 16:10

Jarosław Kończak