I'm using SmartGWT 2.5. With this version, I had to enable drag n drop on the ListGrids of type B as well. I also added a drop handler on ListGrids B that cancels any drop actions by simply calling event.cancel(). It's not the perfect solution but at least it does work.
How to enable drag n drop between nested SmartGWT ListGrids
-
05-12-2021 - |
Frage
I got a ListGrid A that have rows, which can be expanded to display ListGrids of type B. Those ListGrids B also have rows that can be expanded to display ListGrids C. All ListGrids B are fed by the same datasource B, which is linked to datasource A by a foreign key. Similarly, all ListGrids C are fed by the same datasource C, which is linked to datasource B by a foreign key.
I want to enable drag n drop between all those ListGrids C only. So, during ListGrids C initialization, I call these to set up drag n drop engine:
setCanReorderRecords(true); setCanDragRecordsOut(true); setCanAcceptDroppedRecords(true); setDragDataAction(DragDataAction.MOVE);But I can only reorder rows within the same grid. Drag n drop between grids C doesn't work. Anybody has any idea about what I'm missing?
Thanks for any help.
Lösung 2
Andere Tipps
set the same type on all components among which you want to enable drag&drop. I.e. for all list grids of type C use these two methods:
public static final String DRAG_AND_DROP_TYPE = "typeC";
...
tileGridOfTypeC.setDropTypes(DRAG_AND_DROP_TYPE);
tileGridOfTypeC.setDragType(DRAG_AND_DROP_TYPE);
...
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow