Extjs treePanel 的treestore重复加载问题解决
在Extjs 4.2.2 中构建一个treePanel 发现设置rootVisible后 ,treeStore中设置的autoLoad:false不启作用,在组件初始化的时候即加载数据源,造成数据重复加载,google 发现了一个解决方法,记录一下
Ext.define('Example', {
extend: 'Ext.tree.Panel',
title: 'Example',
useArrows:false,
singleExpand : true,
rootVisible: false,
border: false,
listeners : {
itemcontextmenu : {
fn : configAndDelete
},
beforeitemexpand : {
fn : function(record,eOpts){
var self = this;
var proxy = self.getStore().getProxy();
proxy.extraParams.symbol = activeSymbol;
}
}
},
setRootNode: function() {
if (this.getStore().autoLoad) {
this.callParent(arguments);
}
},
initComponent: function () {
var store = Ext.create('Ext.data.TreeStore', {
fields: [
{name: 'id', type: 'string'},
{name: 'text', type: 'string'}
],
autoLoad : false,
proxy: {
type: 'ajax',
url: '/data.php',
reader: {
type: 'json',
root: 'results'
}
}
});
this.store = store;
this.callParent(arguments);
}
});
Ext.onReady(function(){
var tree = Ext.create('Example', {
renderTo: Ext.getBody(),
width: 300,
height: 300
});
tree.getStore().load();
});
Extjs treePanel 的treestore重复加载问题解决的更多相关文章
- Extjs treePanel过滤查询功能【转】
Extjs4.2中,对于treeStore中未实现filterBy函数进行实现,treestore并未继承与Ext.data.Store,对于treePanel的过滤查询功能,可有以下两种实现思路: ...
- 73. 解决ExtJS TreePanel 的 iconCls设置问题
转自:https://blog.csdn.net/hanchuang213/article/details/62881568 很久没有写代码了,最近在做一个在线帮助网站,于是又捡起了 ExtJS,我用 ...
- Javascript - ExtJs - TreePanel组件
TreePanel组件(Ext.tree.TreePanel)logogram:Ext.tree.Panel | xtype:treepanel 树与节点 树面板组件的根是源头,从根上拓展出其它的子节 ...
- ExtJs TreePanel 使用帮助
tree :树 node:节点 1.全部展开 tree.expandAll(); 2.全部收缩 tree.collapseAll(); 3.得到父节点 node.parentNode 4.判断是否有父 ...
- Extjs treePanel 后台Json的两种构建方法
public string json = ""; public string QueryMenuTreeJson(string ParentID, string userId) { ...
- Extjs TreePanel API详解
转自:http://web.qhwins.com/CSS-JS-XML/2011091312092944999107.html config定义{ animate : Boolean, contain ...
- ExtJs TreePanel 全选与反选
selectAll: function() { this.getRootNode().eachChild(function (child) { child.set('checked', true); ...
- Extjs treePanel 加载等待框
beforeload : { fn : function (store, operation, eOpts){ loadMask = new Ext.LoadMask(Ext.get(this.get ...
- ASP.NET MVC 异步获取和刷新ExtJS6 TreeStore
从数据库获取构造树结构是ExtJS TreePanel的核心技术,常用方法是TreeStroe里配置proxy,这种方式的root成了一个不受控制的节点. TreeStroe的root实际是一个层叠j ...
随机推荐
- 程序包com.sun.image.codec.jpeg不存在
在pox.xml中引入依赖 <dependency><groupId>rt</groupId><artifactId>rt</artifactId ...
- linux安装git、node、pm2
一.安装Git 下载:# wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz 解压:# tar -zxvf git-2. ...
- IDEA中一个工程多个模块(module)分别提交到不同的git服务器
说明:本文档适用于一个工程多个模块的项目,每个模块对应不同的git服务器地址. 一.将本地项目导入到git服务器 1.打开 File -> Settings,选择 Version C ...
- [LeetCode]20. Valid Parentheses有效的括号
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inpu ...
- springboot如何实现微信登录,前期准备
现在网站用微信登录真的是很多,那么具体是怎么实现的呢? 首先介绍的是微信开放平台,我们如果需要微信登录或者支付都需要在上面注册一个账号,用这个账号去为我们的网站申请的话,需要用到企业资料(家里有营业执 ...
- PAT 1070 Mooncake
题目意思能搞成这样我也是服了这个女人了 #include <cstdio> #include <cstdlib> #include <vector> #includ ...
- sql: 生日赠品中的相关算法
---2013年10月9日生日,就以2012年9月1日至2013年8月31日計算 (因為係生日月份前兩個月之最後一天為結算日) DECLARE @birthday datetime,@now date ...
- php有经纬度计算距离
/** * @desc 根据两点间的经纬度计算距离 * @param float $lat 纬度值 * @param float $lng 经度值 */ function getDistanc ...
- 01_Quartz基础结构
[各种任务调度的使用场景] 论坛每天凌晨统计论坛用户的积分排名. 论坛每半个小时生成精华文章. 每隔30分钟对锁定过期的用户解锁. 每月1号统计上个月各部门的业务数据. [Quartz 简介] Qua ...
- Windows下COCOS2D-X开发环境配置
1. 下载Android SDK: http://developer.android.com/sdk/index.html ,解压到E:\ADT 目录下 2. 下载NDK: http://develo ...