jquery - How to update multiple rows on kendo grid with outside button -



jquery - How to update multiple rows on kendo grid with outside button -

i have kendo grid columns as:

i write function close button, when user select rows check , click close button, auto update isclosed column "true"

and code:

$(function () { $('#btnclose').click(function () { var grid = $('#grorders').data("kendogrid"); $.each($('#grorders :checkbox:checked').closest('tr'), function () { var info = grid.dataitem($(this)); data.set("isclosed", true); }); }); });

when test, update first row checked, don't know why? please help me.

the problem invoke set("isclosed", true) kendoui redraws grid next grid.dataitem not homecoming expect.

instead, seek doing first each getting list of items need modified , sec each modifying them. like:

$('#btnclose').click(function () { var grid = $('#grid').data("kendogrid"); var rows = $('#grid :checkbox:checked'); var items = []; $.each(rows, function () { var item = grid.dataitem($(this).closest("tr")); items.push(item); }); $.each(items, function(idx, elem) { elem.set("isclosed", true); }); });

jquery asp.net kendo-ui telerik

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -