jQuery - Kendo UI checkbox control -
i've got kendo ui checkbox on data grid header , when ticked, checkboxes on grid rows need ticked , vice versa.
the tricky part make listen each grid row state when row changes checkbox state, grid header should notified change , change state automatically because rows no longer checked/unchecked.
i've gone far , finding hard take further. js bin
would appreciate input.
what following approach, work ?
var $grid = $('#grid'); var grid = $grid.kendogrid().data('kendogrid'); var rowcount = 2; $('.parentcheckbox').click(function () { $('.childcheckbox').prop('checked',this.checked); }); $('.childcheckbox').click(function () { var checkeboxescount = $grid.find('input:checked').size(); $('.parentcheckbox').prop('checked',checkeboxescount == rowcount); });
Comments
Post a Comment