javascript - How to delete a row in Kendo grid with Knockout binding -
well, thought must easy, kendo "destroy" command not work expected when using kendo-knockout binding. deletes row grid, viewmodel not updated.
html:
<div id="gridclients" data-bind="kendogrid: { data: filteredclients, columns: [ {title: 'actions', command: 'destroy'}, { field: 'clientname', title : 'client name' }, { field: 'clientcode', title: 'client code' } ], scrollable: false, sortable: true, pageable: false, editable: true }"> </div> js:
$(document).ready(function () { var clients = { filteredclients: [{ clientname: '1', clientcode: 'value 1' }, { clientname: '2', clientcode: 'value 2'}], header: 'test' }; var viewmodel = ko.mapping.fromjs(clients); ko.applybindings(viewmodel); }); anyway i'm looking different approach because need use checkboxes inside kendo grid rows , need know row uid on checking/unchecking checkbox. did tried add column buttons data-bind="click: somemethod", in case data parameter of somemethod whole viewmodel , don't know how find appropriate row. suggestions appreciated.
thanks, ihor
Comments
Post a Comment