`
gao_20022002
  • 浏览: 160223 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

EXTJS4 郁闷的Loading

 
阅读更多

使用EXTJS4,写联动的combo控件,首次选择联动效果,可以正常显示和选择。

 


 

再次切换选择‘一级编码’,动态加载‘二级编码’数据可以正常加载,但是始终出现一个loading的遮盖层,选择不了下拉数据,奇怪的问题,寻求解决方案:

 


 

代码格式基本如下:

 

1、存储first_store,‘一级编码’的数据源,设置为autoLoad : true

 

 

var first_store = Ext.create('Ext.data.Store', {
			model : 'eht.model.ColVal',
			proxy : {
				type : 'ajax',
				url : '../myconfig/Config_viewConfigForCV.go?command=all.first&n='+new Date().getTime(),
				fields : ['col_id', 'col_name'],
				reader : {
					type : 'json',
					root : 'data'
				}
			},
			autoLoad : true,
			remoteSort:true
		});

 2、combo的‘一级编码’,在select中处理‘二级编码’的查询设置。

 

 {
		       	                xtype : 'combo',
		       	                fieldLabel : '一级编码',
		       	                blankText : "此项不能为空",
								emptyText : '此项不能为空',
								allowBlank : false,
								margin : '0 5 0 0',
								id : 'first_id',
								name : 'first_id',
								hiddenName : 'first_id',
								displayField : "col_name",
								valueField : "col_id",
								triggerAction: 'all',
								queryMode: 'local',
								store : first_store,
								listeners : {
										select : function(combo, record, index) {
											Ext.getCmp('second_id').clearValue();
											Ext.getCmp('second_id').store.load({params:{first_id:combo.value}});
											
										}
								}
							}

 3、cmbo的‘二级编码’设置

 

xtype : 'combo',
		        	          editable : false,
							  allowBlank : false,
							  margin : '0 5 0 0',
							  fieldLabel : '二级编码',
							  id:'second_id',
							  name:'second_id',
							  hiddenName:'second_id',
							  emptyText : '请选择...',
							  displayField : 'col_name',
							  valueField : 'col_id',
							  queryMode: 'local',
							  triggerAction: 'all',
							  typeAhead: true,
							  store : 
							  	{
							        extend: 'Ext.data.Store',
									model : 'eht.model.ColVal',
									proxy : {
										type : 'ajax',
										url : '../myconfig/Config_viewConfigForCV.go?command=all.second&n='+new Date().getTime(),
										fields : ['col_id', 'col_name'],
										reader : {
											type : 'json',
											root : 'data'
										}
									},
									autoLoad : false,
									remote : true,
									remoteSort:true,
									listeners : {
										load: function(store){
										    Ext.getCmp('second_id').setValue(store.getAt(0).get('col_id')) 
										} 
									}
							  },
							  lastQuery: ''
				            }

 4、不知道哪里的问题,可以看见数据都可以正常加载,就是在选择那个‘二级编码’后,切换‘一级编码’,再次选择‘二级编码’,就出现一个loading的遮盖层,选择不了数据,但是数据可以看见已经正常加载了????

  • 大小: 6.3 KB
  • 大小: 4.2 KB
分享到:
评论
5 楼 zbg1983 2013-05-09  
jumboluo 写道
这是一个Ext的一个bug:
http://www.sencha.com/forum/showthread.php?153490-Combo-Box-Store-Loading

解决方法:
store.on('load', function (store, records, successful, options) {
    if (successful && Ext.typeOf(combo.getPicker().loadMask) !== "boolean") {
        combo.getPicker().loadMask.hide();
    }
});

4 楼 caelyntang 2012-12-26  
在二级联动加载的时候提前加载一次二级联动,不是根据一级联动的值加载的哦
3 楼 55558888 2012-08-09  
将 queryMode: 'local', 改为  queryMode: 'remote'
2 楼 jumboluo 2012-03-30  
这是一个Ext的一个bug:
http://www.sencha.com/forum/showthread.php?153490-Combo-Box-Store-Loading

解决方法:
store.on('load', function (store, records, successful, options) {
    if (successful && Ext.typeOf(combo.getPicker().loadMask) !== "boolean") {
        combo.getPicker().loadMask.hide();
    }
});
1 楼 jumboluo 2012-03-30  
也遇到同样的问题,也不知道怎么解决啊。

相关推荐

    Extjs的loading效果

    利用Extjs和css实现 加载时的缓冲效果页面

    解决extjs API文档不断Loading

    NULL 博文链接:https://macrotea.iteye.com/blog/792441

    ExtJs 2.2 简明教程 01 入门

    自己写的ExtJs简明教程,第一节是入门,包括如下内容: ExtJs包的内容和简介 Spket插件的安装 API的使用和安装(针对不停loading的问题) 还有入门实例和它的代码

    extjs4的ext-all.js文件

    After loading the form, you will be able to hit submit. The submit action will make a post to the server, and the dummy XML file on the server with test server-side validation failure messages will be...

    jquery loading(遮罩)插件

    jQuery Loading插件用于当DOM元素加载或变化期间,对其进行遮挡阻止用户操作并告知有些后台任务还在进行。实现“正在加载中…”的效果。整个插件只有1kb左右。效果跟extjs遮罩(锁屏)效果基本一样。

    extjs实例教程附带源码

    -- 加载ExtJS的资源 --> <!-- 注意加载顺序 --> <script type="text/javascript" src="./scripts/ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="./scripts/ext/ext-all.js"></...

    spket-plugin-1.6.18破解版(已解决"Loading Context"错误)

    spket-plugin-1.6.18破解版 已解决An internal error occurred during: "Loading Context". 错误 解压后将features和plugins拷贝到MyEclipse的 dropins文件夹下。

    ExtAspNet v2.2.1 (2009-4-1) 值得一看

    注:ExtAspNet基于一些开源的程序ExtJS, HtmlAgilityPack, Nii.JSON, YUICompressor。 示例: http://extasp.net/ 开源: http://extaspnet.codeplex.com/ 博客: http://sanshi.cnblogs.com/ 邮箱: sanshi.ustc@gmail...

    ExtAspNet_v2.3.2_dll

    ExtAspNet - ExtJS based ASP.NET Controls with Full AJAX Support ExtAspNet是一组专业的Asp.net控件库,拥有原生的AJAX支持和丰富的UI效果, 目标是创建没有ViewState,没有JavaScript,没有CSS,没有...

    unigui0.83.5.820

    0.83.4.819 +---------------------------------------------------------------------------------------- - 0000789: UniDBComboBox, UniDBListBox: Edit mode is not set when changed - 0000784: TUniStringGrid...

Global site tag (gtag.js) - Google Analytics