PDA

View Full Version : Setting A ModelData on a treeStore



dhruv.shukla
24 Mar 2011, 4:14 PM
Hello,
I want to update my treePanel one of the node names using TreeStore..

All I am doing for now is
TreeModel tm = store.findModel(id);
if(tm !=null) {
TreeModel parent = tm.getParent();
store.remove(tm);
tm.setName(name);
addNode(parent, tm);
}

But I know this is not the right way to do it Since... it also affects the order of the tree.

Getting the Record from the store and updating it didn't helped.

Record record = store.getRecord(tm);
record.getModel().setName(name);
store.commitChanges();

Any suggestions will be really helpful.

Thanks in advance.,
Drew.