Extjs4.0.7 树加载TypeError: records[i] is undefined [在此错误处中断] ns[i].viewRecordId

后台返回的json树  struts2 返回

 

{
    "lists":[
        {
            "children":[
                {
                    "children":[
                    ],
                    "cls":null,
                    "id":"ptxh",
                    "leaf":true,
                    "parentId":"root",
                    "text":"普通笑话",
                    "type":0
                },
                {
                    "children":[
                    ],
                    "cls":null,
                    "id":"crxh",
                    "leaf":true,
                    "parentId":"root",
                    "text":"成人笑话",
                    "type":2
                },
                {
                    "children":[
                    ],
                    "cls":null,
                    "id":"qs",
                    "leaf":true,
                    "parentId":"root",
                    "text":"糗事",
                    "type":3
                },
                {
                    "children":[
                    ],
                    "cls":null,
                    "id":"lxh",
                    "leaf":true,
                    "parentId":"root",
                    "text":"冷笑话",
                    "type":1
                }
            ],
            "cls":null,
            "id":"root",
            "leaf":false,
            "parentId":null,
            "text":"根节点",
            "type":null
        }
    ]
}

 

store的定义

 

Ext.define('AM.store.JokeStore4Tree',{
    extend:'Ext.data.TreeStore',
    model:'AM.model.JokeModel4Tree',
    defaultRootId:'lists',
    proxy:{
        type:'ajax',
        url:'AppMenu/menu!list',
        actionMethods:'POST',
        reader:{
            type:'json',
            root:'lists'
           
        }
    },

     autoLoad:true
})

 

点击根节点的+号后会再次向后台发请求  请求action 为store里面的url

继续返回上面的json  并报错  希望能给个解答

 

 
 
TypeError: records[i] is undefined
  
  
Error: Permission denied to access property 'toString'

你可能感兴趣的:(ExtJs,extjs4,Extjs树)