Hi,
I try to save the order of the elements of a treePanel<ModelData> in order to reproduce this ordre later. (I already developpe the server side).
When I want to set the new order for each element
When I try to update the position of each elem the list I have do not contains
the operation I could make. It is exactly the same list in the same order than when I create the store..
Code:
model = new ModelPopup(listeModel, true);
store = new TreeStore<ModelData>();
store.add(model.getChildren(), true);
final TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
tree.setDisplayProperty("name");
store.sort("order", SortDir.ASC);
new TreePanelDragSource(tree);
final TreePanelDropTarget target = new TreePanelDropTarget(tree){
@Override
public void onDragDrop(DNDEvent e) {
super.onDragDrop(e);
int i = 0;
// I try to update the position of each elem but the list have the order before the first sort
for (ModelData Element : store.getAllItems()){
final ModelArbrePopup element = (ModelArbrePopup) Element;
element.setOrder(i);
GWT.log(element.getName());
i++;
}
}
};
target.setAllowSelfAsSource(true);
target.setFeedback(Feedback.BOTH);
I hope than someone could help me
thanks