PDA

View Full Version : TreeGrid - TreeStore | how to get the present order/oierarchy of the widget



3rik
27 Mar 2012, 11:37 AM
Hello, my Name is Erik and i am new to this Forum and Ext GWT.

Lets come to my Problem:

First I create an TreeGrid with drag and drop, then i want to save the new order / hierarchy when the tree was changed by the user to my database.

The thing is - when I do TreeGrid.getTreeStore.getChildren or something like that it is out of sync with the View, it has only the State when i createt the TreeGrid. When I use TreeGrid.getTreeStor.getRootItems the behaviour is like what I want, but it works only for the Root so i cant get the order of childs further down the tree.

The other option was to update my BaseTreeModel when a drag and drop with the drag and drop Event like

target.addDNDListener(new DNDListener(){ @Override
public void dragDrop(DNDEvent e) {
super.dragDrop(e);
}
});but its not working with reordering items, when I dont drop them on another treeitem.

I searched for 3 days now throught the internet and tryed to do it on my own, the only solution i came up with so far is to extend the whole funtionality of the TreeGrid widget and TreeStore, but i don't think its the right way to go, there must be a way to do what i want out of the box. I mean i only want to get the actual order / hierarchy - state of the TreeGrid -widget.

Thanks for your help.

Greetings, Erik