Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Daniel Moussa on Aug 25, 2008 16:09
open dhtmlx forum
Checking the filtered rows only with #master_checkbox

Hi team,
We have a grid setup with header filters. The first column is of type checkbox and the filter is of type #master_checkbox.
The filter works perfectly fine, however, we noticed the following:

1- If we filter the grid by any value, the grid hides some rows and shows others, very good. If we then want to check the visible rows by checking the master_checkbox we noticed that all the hidden rows are checked also? Obviously this is not desirable as the idea of having master_checkbox to to save you the hassle of checking every single row you want. We

2- Looking at the doco, there no API we call call to get a list of current visible rows in a filtered grid. This is important if we want to implement our check/uncheck routine. Does such API exist but missing fom the doco or is there any way we can get the visible rows Ids?

3- The master_checkbox is not synchronized with the status of the checked rows. If you check the master_checkbox, all rows will be checked, then if you uncheck all of them manually then the master check box maintains its checked state! For professional performance we think the master_checkbox should be a tri-state checkbox (Checked, partial-checked and unchecked) and to respond to the state of any checked box in the column.

Thanks
Daniel
Answer posted by Support on Aug 26, 2008 01:26

>>by checking the master_checkbox we noticed that all the hidden rows are checked also
The existing logic is not usefull in your case, but still it can be logical in different scenario.
You can use attached patch, which will change behavior to desired one. 

>>Does such API exist but missing fom the doco or is there any way we can get the visible rows Ids?

There is no special API, but you can itterate through row by indexes

for (var i=0; i<grid.getRowsNum(); i++)
   some_command(i);

row index can be converted to row ID as
    id = grid.getRowId(index)

>>The master_checkbox is not synchronized with the status of the checked rows. 
This is limitation of current implementation
Technically you can create custom solution - insert any custom checkbox in header and use onCheckbox event to catch moment when some checkbox in grid checked|unchecked
Attachments (1)