Hi experts,
I have a Lock column shows checkboxes and it's underlying datasource is of bool type. Is there a good way to add a checkbox at column header, and if I check that box, all checkboxes in that column should be checked?
Option 2, if there is no such way. Is there a way to manually modify the datasource of iggrid, set the all lock to true via javascript, so that I can rebind the all checked datasource to grid again? Does iggrid provide such kind of api to do that?
Hello srajagopal,
I would suggest you to use igGrid Row Selectors feature in order to achieve "select all" functionality. Here is a jsFiddle link that demonstrates a sample with such functionality for your reference: http://jsfiddle.net/gwds7bh9/ If I can provide you with further assistance, please let me know.
Regards,
Tsanna
Hello Tsanna, thank you for your reply. My lock column is binding to an underlying datasource column, I enabled updating feature, so the lock column is actually a editable column. Row selector just gives a way to select rows, but cannot edit it's datasource. Is there a way to check a header checkbox and then all checkboxes are checked, and datasource are updated?
Hi,
If you want to select across all pages, then you need to loop through the whole data source, for example:
for(var i = 0; i < adventureWorks.length; i++) { rowId = adventureWorks[i].ProductID; $("#grid").igGridUpdating("setCellValue", rowId, "MakeFlag", true); }
Another approach to get the datasource records is: $("#grid").data("igGrid").dataSource.data().length
If you have further questions, please let me know.
that's a smart solution! But it works only on the first page?
I created a sample with similar scenario for your reference. Please check it and let me know if it helps you resolving your issue.