PDA

View Full Version : disabling rows in a grid



zdarsky
22 Jul 2009, 6:13 AM
Is there a way how to disable selection for a row in a grid?

I need for some rows to appear to be disabled. = gray color and not posible to click on.

thanks,
Martin

troyg
13 Aug 2009, 8:14 PM
We're wanting to do something similar. Did you find a solution in the end?

zdarsky
13 Aug 2009, 10:57 PM
Hi,

firstly, you need to use implement a selectionModel


GridSelectionModel<BeanModel> questionGridSelectionModel = grid.getSelectionModel();
questionGridSelectionModel.addSelectionChangedListener(new SelectionChangedListener<BeanModel>() {
@Override

publicvoid selectionChanged(SelectionChangedEvent<BeanModel> se) {
// you need to decide when to cancel the selection
se.setCancelled(true);

}

secondly, if you want a gray color, cursor etc. then you need to assign style

"grid-item-disabled" or "grid-item-enabled";

troyg
16 Aug 2009, 12:18 PM
Thanks, much appreciated. I'll try that today.