See the attached image. I have a column of checkboxes but for some cells I have to remove the checkbox and display something else. But when I call
checked = mygrid.getCheckedRows(1);
it always returns the IDs for the image rows. So in the picture, it returns 3 IDs, I would expect it to only return 1. Can you fix the function so that it only applies to checkboxes since that is its purpose? Thanks!
![]()
Unfortunately such feature is not available.
getCheckedRows() method works with the value of a cell only.
I don’t understand. The cell doesn’t contain a checkbox, or even a checkbox that is checked, so what is it keying off of to think there is one? This is kind of a show stopper for me. Any idea how I could replace or overload the getCheckedRows() function? Thanks.
This works for me…
var checked = []
mygrid.forEachRow(function(id){
if (mygrid.cells(id, 1).getValue() == 1)
checked.push(id);
});
I just don’t understand why getCheckedRows() doesn’t do something similar.
I almost forgot, If you want the same type of results that getCheckedRows() gives then don’t forget to call join() to turn the array into a comma separated string.
var checked = []
mygrid.forEachRow(function(id){
if (mygrid.cells(id, 1).getValue() == 1)
checked.push(id);
});
checked = checked.join();
Your issue is fixed.
GetCheckedRows method now checks if the cell is a checkbox or radio button.
Please, open ticket at support.dhtmlx.com to get the fix.