Backbone collections representing tree data
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to load json data in form of a tree into Backbone Collection. I can't do this. Can anyone explain what I'm doing wrong? My very simple model: CTreeDataItem = Backbone . Model . extend ( { }); CTreeDataItems = Backbone . Collection . extend ( { model : CTreeDataItem }); And my load attepmt: var treeJs = [ { id : "tvRoot" , title : 'Root' , cssClass : 'root' , items : [ { id : "ti1" , title : 'Item1' , cssClass : 'item' , items : [ { id : "ti11" , title : 'SubItem11' , cssClass : 'subitem' }, { id : "ti12" , title : 'SubItem12