I am using RESTful Json service to fill my tree data model using Dojo Toolkit.
I’ve spotted in documentation that there is a way to use relational parent/child mapping i.e. use child.parentId attribute to point at parent, instead of parent.children to specify children for a parent. Also, on new node creation (newItem on model, and save on Store afterwards) I want only one REST POST query with new node data and a parent id.
What should I do with my Tree, TreeStoreModel or JsonRestStore to enable such behavior? Thanks!
What documentation are you looking at? It should have explained what to do there already…
Thee tree model must implement a
getChildrenmethod. In order to use a relational representation all you need to do is override this method yourself. There is nothing you need to do with the Tree and the JSONStore.This may help: http://dojo-toolkit.33424.n3.nabble.com/dijit-tree-Model-in-relational-model-format-td3248820.html