星空网 > 软件开发 > 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.vstour.cn/t/巴厘岛酒店排名.html
巴厘岛酒店推荐:https://www.vstour.cn/t/巴厘岛酒店推荐.html
巴厘岛酒店预定:https://www.vstour.cn/t/巴厘岛酒店预定.html
巴厘岛可以旅游了吗:https://www.vstour.cn/t/巴厘岛可以旅游了吗.html
巴厘岛可以去了:https://www.vstour.cn/t/巴厘岛可以去了.html
巴厘岛可以去了不:https://www.vstour.cn/t/巴厘岛可以去了不.html
珠海市图书馆官网入口:https://www.vstour.cn/a/335174.html
珠海图书馆几点开门几点关门?附营业时间:https://www.vstour.cn/a/335175.html
相关文章
我的浏览记录
最新相关资讯
跨境电商服务平台 | 深圳旅行社 | 东南亚物流