星空网 > 软件开发 > Java

sencha treestore 取消自动加载数据

gridstore在设置了autoLoad=false后不会自动加载数据,但是treestore不行,后来发现删掉root里的expanded:true后就可以了。但是界面上树没有展开,需在store的load回调里加上展开根节点的代码:tree.getRootNode().expand();

 

store定义:

Ext.define('portaltest3.store.OrgTreeStore', {
extend: 'Ext.data.TreeStore',

requires: [
'Ext.data.proxy.Ajax',
'Ext.data.reader.Json',
'Ext.data.Field'
],

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: false,
storeId: 'OrgTreeStore',
root: {
name: '根节点',
//expanded: true  //删掉
},
proxy: {
type: 'ajax',
extraParams: {},
url: 'DataService/Manage/Manage.ashx',
reader: {
type: 'json'
}
},
fields: [
{
name: 'Name'
},
{
name: 'Id'
}
]
}, cfg)]);
}
});

 

From:http://www.cnblogs.com/xuejianxiyang/p/5284222.html




原标题:sencha treestore 取消自动加载数据

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

缅甸专线货运:https://www.goluckyvip.com/tag/38721.html
缅甸专线空运:https://www.goluckyvip.com/tag/38722.html
面试问你问什么加入跨境电商:https://www.goluckyvip.com/tag/38723.html
秒递物流:https://www.goluckyvip.com/tag/38724.html
秒杀布局:https://www.goluckyvip.com/tag/38725.html
淼畅物流:https://www.goluckyvip.com/tag/38726.html
从园岭新村到大梅沙海滨总站坐什么车:https://www.vstour.cn/a/363191.html
七月份适合去日本旅游吗 7月份去日本哪里好玩:https://www.vstour.cn/a/363192.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流