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