GWT 2.5 Choosing a DataGridModel with Arrows

When using TableBuilder to create rows and subscripts, the selection model does not work properly. When you click on the substring check box, the row is not selected, however, the parent row is selected instead.

I tried reloading the onBrowserEvent to manually handle the selection, but it seems that the DataGrid itself fires a selection event when the checkbox is clicked.

If strings and binder are of the same type, how to add a selection model that supports both strings and dashes?

+7
source share
1 answer
 @Override public void onBrowserEvent(Context context, Element elem, final T object, NativeEvent event) { // The provided row is always the root row, so we need to find the // correct one when a sub row was edited actualIndex = context.getSubIndex(); actualObject = object; if (0 != context.getSubIndex() && object instanceof RowDTO) { actualIndex = context.getSubIndex(); actualObject = (T) ((RowDTO) object).getChild(actualIndex - 1); context = new Context(context.getIndex(), context.getColumn(), actualObject, actualIndex); } ValueUpdater<C> valueUpdater = (getFieldUpdater() == null) ? null : new ValueUpdater<C>() { @Override public void update(C value) { getFieldUpdater().update(actualIndex, object, value); } }; getCell().onBrowserEvent(context, elem, getValue(actualObject), event, valueUpdater); } 
0
source

All Articles