My kendo grid looks like:
I have change/dataBound
methods used to both check the box and highlight selected row:
change: function (e) {
$('tr').find('[type=checkbox]').prop('checked', false).removeAttr('aria-selected');
$('tr.k-state-selected').find('[type=checkbox]').prop('checked', true);
},
dataBound: function (e) {
$(".checkbox").bind("click", function (e) {
$(e.target).closest("tr").toggleClass("k-state-selected");
});
},
I need to get data when one row is selected, and I can do it in change
method by extracting dataItem
from selected row. Problem is, change
method is triggered only when I click on whole row, but not when I click on checkbox. How can I trigger event on both clicking on checkbox or row?