In a dhtmlxTreeGrid, when I apply the filter #select_filter on a column of type ‘ch’ (checkbox) I see multiple values in the drop down box. If all checkboxes are in selected state, the dropdown box has values ‘1’ and ‘true’. If both selected and unselected checkboxes are present, the dropdown has 4 values - ‘0’, ‘false’, ‘1’, ‘true’. Can anyone please help on why this is happening and a way to get rid of it? (I need only true/false to show up on the dropdown).
The grid column is backed by a column of type ‘boolean’ at the backend.
Thanks,
Derrick.
Problem caused by usage of smart rendering or paging mode and different checkbox values.
Normally checkbox uses 0 and 1 as values ( unchecked and checked states ) , when grid founds true in xml it automatically converts to 1 and false to 0. ( it is fallback for common bool interpretation, but still grid awaits 0 or 1 values in first place )
In case of buffered view ( srnd or paging ) grid not renders all data, so when building list of options it gets 1 and 0 from already rendered rows and row values true and false from rows which was not rendered yet.
To fix issue you can
a) change the format of data and provide 1 and 0 values instead of true and false.
or
b) grid 2.1 allows to define custom list of options for select filter as
grid.attachEvent(“onCollectValues”, function(index){
if (index == 2)
return [“one”,“two”,“three”]; //options for select filter
else
return true; //default processing
});