使用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
分享到:
相关推荐
利用Extjs和css实现 加载时的缓冲效果页面
NULL 博文链接:https://macrotea.iteye.com/blog/792441
自己写的ExtJs简明教程,第一节是入门,包括如下内容: ExtJs包的内容和简介 Spket插件的安装 API的使用和安装(针对不停loading的问题) 还有入门实例和它的代码
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插件用于当DOM元素加载或变化期间,对其进行遮挡阻止用户操作并告知有些后台任务还在进行。实现“正在加载中…”的效果。整个插件只有1kb左右。效果跟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破解版 已解决An internal error occurred during: "Loading Context". 错误 解压后将features和plugins拷贝到MyEclipse的 dropins文件夹下。
注:ExtAspNet基于一些开源的程序ExtJS, HtmlAgilityPack, Nii.JSON, YUICompressor。 示例: http://extasp.net/ 开源: http://extaspnet.codeplex.com/ 博客: http://sanshi.cnblogs.com/ 邮箱: sanshi.ustc@gmail...
ExtAspNet - ExtJS based ASP.NET Controls with Full AJAX Support ExtAspNet是一组专业的Asp.net控件库,拥有原生的AJAX支持和丰富的UI效果, 目标是创建没有ViewState,没有JavaScript,没有CSS,没有...
0.83.4.819 +---------------------------------------------------------------------------------------- - 0000789: UniDBComboBox, UniDBListBox: Edit mode is not set when changed - 0000784: TUniStringGrid...