extjs4.2 tree panel 重复加载!

这是后台返回的JSON
{"mytree":[{"description":"faffaf","name":"wafa","children":[{"description":"wowowo","name":"hahaha","leaf":true,"expanded":true}],"info":"xxxxxx"}]}

前台点开节点时,它一直重复发请求如图
CSDN移动问答

js 代码如下

enter code her  evar store = Ext.create('Ext.data.TreeStore', {
    fields: ['name', 'description','info'],
    proxy : {
        type : 'ajax',
        url : 'ziyuan/getData.do',
        reader: {
            root: 'mytree',
            type: 'json'
        }
    },
    root:{
        name:"xxx"
    }

}); 

enter code here Ext.create('Ext.tree.Panel', {
    renderTo: Ext.getBody(),
    store : store,
    title: '一颗拥有多列的树',
    columns: [{
        xtype: 'treecolumn',
        text: '节点名',
        dataIndex: 'name',
        width: 150,
        sortable: true
    }, {
        text: '描述',
        dataIndex: 'description',
        flex: 1,
        sortable: true
    }, {
        text: '信息',
        dataIndex: 'info',
        flex: 1,
        sortable: true
    }]

});

查看全部
qqqsxl
qqqsxl
2014/10/29 08:53
  • 重复加载
  • tree
  • extjs
  • 点赞
  • 收藏
  • 回答
    私信

3个回复