First of all sorry my poor english. I have a grid in lazy mode (using data provider) and it has a column contains CheckBox somtimes is visible, sometimse is not, dependent on data. When it show the check box columns showing fine but after sorting another column the checkboxes showing mixing.
Where it not should be appear it showing after sorting other column. Data is correct. Here is my code:
Grid.Column col = getGrid().addColumn(( EventStorage source ) -> {
if ( source.getModel().hasDelegate()) {
source.setVisibleCheckBox(Boolean.FALSE);
source.setCheckBoxEnable(Boolean.FALSE);
} else {
source.setVisibleCheckBox(Boolean.TRUE);
source.setCheckBoxEnable(Boolean.TRUE);
}
return source.getCheckBox();
}, new ComponentRenderer());
Please give me advice.
Maybe you should use addComponentColumn()
? So not addColumn(..)
& ComponentRenderer
. Like
Grid.Column col = getGrid().addComponentColumn(( EventStorage source ) -> {
if ( source.getModel().hasDelegate()) {
source.setVisibleCheckBox(Boolean.FALSE);
source.setCheckBoxEnable(Boolean.FALSE);
} else {
source.setVisibleCheckBox(Boolean.TRUE);
source.setCheckBoxEnable(Boolean.TRUE);
}
return source.getCheckBox();
});