Hello,
According to documentation the change event should be fired when grid selection is changed. But this event don't occurs when row or cell is "unselected" by operations like sort or page change. Is there any way to detect that situation?
The only way I know of to do this would be to override the grid's dataSource sort and page functions. Within the new sort or page function, raise an event and then call the original sort or page function.
If I had a grid defined as follows:
vargrid = $("#grid").kendoGrid({
dataSource: data,
columns: [
{
field: "product",
title: "Product",
sortable: true
},
{
field: "control",
title: "Control"
}
],
selectable: "row",
sortable: true,
pageable: {
pageSize: 5
}
}).data("kendoGrid");
I could override the grid's dataSource sort and page functions like this:
// Save the reference to the original sort function.
Thank you for quick response with great example. I have expected, that solution will not be simple - the changes that you provided for datasource events 'page' and 'sort' should be also introduced for the 'group', 'filter', etc. Maybe someday Kendo team will expand the scope of the event 'change' (or rename it to 'select' :-) )