문제

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.

도움이 되었습니까?

해결책 2

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.

다른 팁

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);
    ...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top