Hi,
I'm wondering if there's a way that my application can cancel (or simulate the cancellation of) a selection change in a ListGrid.
I'm using SmartGWT 3.0 (the dev console version info reads "SC_SNAPSHOT-2011-12-05/LGPL Development Only").
Here's roughly what I'd like to do:
It seems to be the case that the selection changed handler and the selection event classes don't provide a simple call to cancel the selection change. I've looked over the javadocs for SelectionUpdatedHandler and for ListGrid, and I don't see a simple way to catch the selection changes and conditionally prohibit them.
Has anyone tried anything like this? Is there a simple way that I can maintain some state in my code to handle this case, or some sneaky workaround?
Thanks!
I'm wondering if there's a way that my application can cancel (or simulate the cancellation of) a selection change in a ListGrid.
I'm using SmartGWT 3.0 (the dev console version info reads "SC_SNAPSHOT-2011-12-05/LGPL Development Only").
Here's roughly what I'd like to do:
Code:
public class GridView { protected void configureGrid() { grid.addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent selectionEvent) { if (someCondition) { // do not allow the selection to change, or change it back // part of this logic would ideally use an SC.ask to confirm a change with the user } else { // handle the selection change normally } } }); } }
Has anyone tried anything like this? Is there a simple way that I can maintain some state in my code to handle this case, or some sneaky workaround?
Thanks!
Comment