开发者

Dojo Tree: inverse parent/child relations

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 getChildren method. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜