Hi community.
I'm trying some drag an drop experiences, and I was wondering if is possible to make a row in a grid or editor grid as a drop target.
Lets see some code:
My DragSource
Code:
final ContentPanel cp = new ContentPanel();
cp.setCollapsible(true);
cp.setHeading("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae tellus vitae quam accumsan congue. Quisque quis mauris.".substring(0, 15) + "...");
cp.addText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae tellus vitae quam accumsan congue. Quisque quis mauris.");
cp.setWidth(200);
cp.setScrollMode(Scroll.AUTO);
cp.setIconStyle("icon-pdf");
cp.setBodyStyleName("warn-window");
new Resizable(cp);
DragSource source = new DragSource(cp) {
@Override
protected void onDragStart(DNDEvent event) {
event.data = cp;
event.status.update("Drag Name: BLAH BLAH BLAH<br/> Drag Description: BLAH BLAH BLAH");
Log.debug("pumba");
}
};
source.setGroup("test");
My DropTarget
Code:
EditorGrid<BeanModel> grid = new EditorGrid<BeanModel>(store, getColumnModel());
grid.setAutoExpandColumn("text");
grid.setBorders(true);
grid.setLoadMask(true);
grid.getView().setForceFit(false);
grid.setTrackMouseOver(true);
GridDropTarget target2 = new GridDropTarget(grid){
protected void onDragDrop(DNDEvent e) {
super.onDragDrop(e);
Log.debug("allright");
}
};
target2.setAllowSelfAsSource(false);
target2.setGroup("test");
The GridDropTarget only makes the grid panel "dropable" and implements the feedback actions "automatically", am I right?
I have three questions.
First, in the drop event can I know if the drop was made over a ROW?
Second, can i make a ROW as drop target?
Third, can i make a CELL as drop target?
If any of my questions as no answer I think this is a good "add on" to GXT.
Sorry my English
Regards
Paulo Jesus