I would like to implement grid with virtualization and one column with checkboxes. Each checkbox should display it's 'checked/unchecked' states when scrolling among pages.
Thanks in advance,
Andrii Frankiv
3 Answers, 1 is accepted
0
Alexander Popov
Telerik team
answered on 18 Nov 2014, 09:42 AM
Hello,
This could be achieved by storing the selected items in an array, then restoring the selection when the Grid's dataBound event gets triggered. For example:
Thanks a lot for your reply, but have can implement this using MVVM pattern? The idea is that inside viewmodels I'm not allowed to access DOM elements and modify their state.
F.E. the code below is not recommended to be implemented inside viewmodel.
this.tbody.find("tr[data-uid='" + view[i].uid + "']")
.addClass("k-state-selected")
.find(".checkbox")
.attr("checked","checked");
Regards,
Andrii Frankiv
0
Alexander Popov
Telerik team
answered on 01 Dec 2014, 08:52 AM
Hello Andrii,
This could be achieved by adding a boolean field to the model and binding the checkboxes to it using the checked binding. Then, once the Grid's DataBound event is triggered you can check the value of the boolean field and decide whether to call the select method.
Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!