您的位置:首页 > Web前端 > JavaScript

ExtJS6 treegrid 一次加載数据后,点击展开仍然会从服务器取数据

2018-01-04 17:51 453 查看
Ext.create("Ext.tree.Panel", {
flex: 1,
store: {
type: 'tree',
fields: ['d_name', 'parentid', 'parentname', 'd_type',
'd_icon', 'd_fuzeren', 'd_tel', 'd_fax', 'd_add',
'd_email', 'd_miaoshu', 'd_order', 'isDelete', 'Delete_time', 'DeviceId'],
proxy: {
type: 'ajax',
url: '/data/hr_department.ashx?Action=treegrid',
reader: {
type: 'json',rootProperty: 'Rows',idProperty: 'id'
}
}
},
id: 'depTreeGrid',
useArrows: true,
rootVisible: false,
multiSelect: false,
singleExpand: false,
columns: [{ xtype: 'treecolumn', text: '门店名称', dataIndex: 'd_name', width: 180 },
{ text: '负责人', dataIndex: 'd_fuzeren', width: 100 },
{ text: '电话', dataIndex: 'd_tel', width: 100 },
{ text: '邮箱', dataIndex: 'd_email', width: 100 },
{ text: '传真', dataIndex: 'd_fax', width: 100 },
{ text: '地址', dataIndex: 'd_add', width: 180 },
{ text: '描述', dataIndex: 'd_miaoshu', width: 150 },
{ text: '绑定设备', dataIndex: 'DeviceId', width: 150 },
{ text: '排序', dataIndex: 'd_order', width: 100 }],
listeners: {
afterrender: function (pObj, eOpts) {
AppCommon.toolbar(pObj, 21, []);
}
}
});
去掉store的proxy配置中的红线部分,检查输出数据中子节点属性是否是children
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Extjs TreeGrid
相关文章推荐