How to maintain checkbox selected after navigation through different pages in jsgrid through jquery? -
unable maintain data or (checkbox selection) after page navigation? or can example:i on page 1 of jsgrid , have checked 2 rows using check box available on row , navigate second page , again come first 1 selection lost.
add field on data item track checkbox state. in itemtemplate
restore value on each rendering.
{ name: "fieldname", align: "center", itemtemplate: function(value, item) { return $("<input>").attr("type", "checkbox") .attr("checked", value || item.checked) .on("change", function() { item.checked = $(this).is(":checked"); }); } }
here working fiddle http://jsfiddle.net/tabalinas/xo1npabw/
as alternative can store checkbox state in separate array in demo "batch delete" on demo page.
Comments
Post a Comment