PDA

View Full Version : TreeStore / NodeInterface issue - Why is response data not take for new node?



ThorStan
17 Jan 2014, 2:33 AM
Hi folks,

i insert a new node into an existing parent node like:



...
var root = this.getRootNode(),
parent = root.findChild('type', myType, true);

parent.insertChild(0, {
entityId: id,
text: text,
qtip: text,
oType: context,
leaf: true
});
...


Now autoSync is true, insertChild will do an ajax call to the backend. New item is created and data is given back as json. Problem now, the new node doesnt take the data from the response, e.g id is 0.

Any ideas?

Thanks in advance,

ThorStan
17 Jan 2014, 2:49 AM
Oki i solved it myself, finally. Problem was the json response. It wasnt in the correct nested format. Must start with index "0" without root "data" attribute, /close

Gary Schlosberg
17 Jan 2014, 6:45 AM
Glad to hear it, and thanks for posting the solution.