TreeGrid: setting data root has no effect

后端 未结 4 742
小蘑菇
小蘑菇 2021-01-20 07:12

I\'m trying to setup a TreeGrid, my data object looks like this:

{
    \"code\": \"success\",
    \"data\": {
        \"text\": \".\",
        \"children\":          


        
4条回答
  •  走了就别回头了
    2021-01-20 07:46

    You can also use this:

            reader: {
            type: 'json',
            // See http://stackoverflow.com/questions/9159627/extjs-loading-tree-from-json-file-using-mvc
            // http://stackoverflow.com/questions/6263380/extjs4-json-treestore
            root: function(o) {
                if (o.data) {
                    return o.data;
                } else {
                    return o.children;
                }
            }
        }, 
    

提交回复
热议问题