1. 程式人生 > >ExtJS6 treegrid 一次載入資料後,點選展開仍然會從伺服器取資料

ExtJS6 treegrid 一次載入資料後,點選展開仍然會從伺服器取資料

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