87,992
社区成员
发帖
与我相关
我的任务
分享Ext.define('MDM.view.DeviceOperate.DeviceOperate_tree', {
extend:'Ext.tree.Panel',
requires:[
'Ext.tree.*',
'Ext.data.*'
],
alias:'widget.deviceoperatetree',
xtype:'tree-reorder',
store:'DeviceOperateTree_Store',
rootVisible:false,
useArrows:true,
border:0,
bodyCls:'tree-body',
cls:'org',
enableDD:false,
loadMask: true,
animate: false,
plugins: [{
ptype: 'bufferedrenderer'
}],
initComponent:function () {
var store = this.store;
Ext.apply(this, {
store:store,
listeners:{
'itemclick':function (obj, record, item, index, e, eOpts) {
console.log(record.data.name);
}
}
});
this.callParent();
},
onExpandAllClick:function () {
var me = this,
toolbar = me.down('toolbar');
me.getEl().mask('Expanding tree...');
toolbar.disable();
this.expandAll(function () {
me.getEl().unmask();
toolbar.enable();
});
},
onCollapseAllClick:function () {
var toolbar = this.down('toolbar');
toolbar.disable();
this.collapseAll(function () {
toolbar.enable();
});
}
});
Ext.define("MDM.store.DeviceOperateTree_Store", {
extend:'Ext.data.TreeStore',
model:'MDM.model.DeviceOperateTree_Model',
proxy:{
type:'ajax',
url:'/justsy/department/search/tree',
// url:'data/test.json',
reader : {
type:'json',
root:'content'
}
},
pageSize:100,
autoLoad:true
})