实际上很容易,定义监听事件,触发后更改下一级的数据源即可
/**
* 创建搜索表单
*/
function formPannel () {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
return new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url:'save-form.php',
//frame:true,
border:false,
//title: 'Simple Form',
bodyStyle:'padding:5px;background-color:#d2e0f2;',
width: 500,
buttonAlign:'right',
labelAlign:'right',
items: [
{
xtype:'fieldset',
title:'查询条件',
autoHeight:true,
defaultType: 'textfield',
items:[
gameSelect = new Ext.form.ComboBox({
fieldLabel: "游戏",
hiddenName:'game',
store: gameds,
valueField:'game_id',
displayField:'game_name',
editable:false,
mode: 'remote',
triggerAction: 'all',
emptyText:"请选择",
selectOnFocus:true,
allowBlank:false,
blankText:'请选择一款游戏',
anchor: '96%',
listeners:{
select:function(gameSelect){
serverSelect.setValue('');
serverds.load({params:{game: gameSelect.getValue()}});
}
}
}),serverSelect = new Ext.form.ComboBox({
fieldLabel: "所在大区",
hiddenName:'area',
store: serverds,
valueField:'server_id',
displayField:'server_name',
editable:false,
mode: 'local',
triggerAction: 'all',
emptyText:"请选择",
selectOnFocus:true,
allowBlank:false,
blankText:'请选择大区',
anchor: '96%',
listeners:{//添加监听事件
select:function(o){
serverListSelect.setValue('');
serverlistds.load({params:{game: formPanel.form.findField('game').getValue(),server_id:serverSelect.getValue()}});// 重新加载数据源
}
}
}),serverListSelect = new Ext.form.ComboBox({
fieldLabel: "所在服务器",
hiddenName:'server',
store: serverlistds,
valueField:'list_id',
displayField:'list_name',
editable:false,
mode: 'local',
triggerAction: 'all',
emptyText:"请选择",
selectOnFocus:true,
allowBlank:false,
blankText:'请选择服务器',
anchor: '96%'
}), {
fieldLabel: '玩家人物名',
name: 'character',
anchor: '96%'
}, {
fieldLabel: '代币数',
name: 'emoney',
anchor: '96%'
}
]
}
],
buttons: [{
text: '查询',
//查询函数开始
handler: function(){
if(formPanel.form.isValid()){
searchds.load({params:{start:0, limit:50, forumId: 4,server: formPanel.form.findField('server').getValue(),character:formPanel.form.findField('character').getValue(),emoney:formPanel.form.findField('emoney').getValue()}});
searchds.on('beforeload',function(){
Ext.apply(
this.baseParams,
{
server: formPanel.form.findField('server').getValue(),character:formPanel.form.findField('character').getValue(),emoney:formPanel.form.findField('emoney').getValue()
});
});
}
}
//查询函数结束
}]
});
}
分享到:
相关推荐
Extjs4---combobox省市区三级联动+struts2
很多网友在问,Extjs4.0 ComboBox如何实现,好在之前用3.x实现过一个三级联动,如今用Extjs4.0来实现同样的联动效果。其中注意的一点就是,3.x中的model:’local’在Extjs4.0中用queryMode: ‘local’来表示,而且在...
应用extjs4和struts2开发的省市区三级联动完整示例,导入myeclipse即可用,无需再导入任何jar包
NULL 博文链接:https://ruohanfly.iteye.com/blog/2183068
基于vs2010的省市三级联动的DropDownList+Ajax的三种框架(aspnet/Jquery/ExtJs) 示例源代码。
NULL 博文链接:https://weijunfeng126.iteye.com/blog/784308
1整体项目基于WPF的MVVM框架,分为上左中三部分,可伸缩; 2仿Extjs的左菜单,可动态绑定数据集,采用fontawesome作为图片; 3左菜单联动的中间部分的Tab控件,Tab页可关闭。 补充:该项目用vs2012运行。 准备...
本文主要列举了省市三级联动的DropDownList+Ajax的三种框架(aspnet/Jquery/ExtJs)示例。前段时间需要作一个的Web前端应用,需要用多个框架,一个典型的应用场景是省市三级联动,基于此应用,特将三种主要的ajax框架...
extjs控件,是本科的毕业设计,最后获得优秀,老师评价非常好。主要有图表控件、一级、二级、三级联动下拉列表框控件
NULL 博文链接:https://dengli19881102.iteye.com/blog/1046661
ExtJS4学习笔记(十六)---Combobox三级联动 ExtJS4学习笔记(十四)--- ComponentQuery ExtJS4学习笔记(四)---Grid的使用 Extjs4开发笔记(三)——菜单的实现 Extjs4开发笔记(二)——框架的搭建 Extjs4开发笔记(五)——...
ExtJs+XML实现 省市县三级联动,压缩包内包含所有文件, 打开index.html可直接看效果,无需任何配置。 XML中包含全国省市县信息!
5.4.6 创建三级或多级菜单 5.4.7 具有选择框的菜单 第6章 页面元素与模板 6.1 构成用户界面的元素 6.2 获取页面元素 6.3 元素常见的使用方法 6.3.1 常见的“显示/隐藏”方法 6.3.2 常见的“内容控制”方法 ...
5.4.6 创建三级或多级菜单 5.4.7 具有选择框的菜单 第6章 页面元素与模板 6.1 构成用户界面的元素 6.2 获取页面元素 6.3 元素常见的使用方法 6.3.1 常见的“显示/隐藏”方法 6.3.2 常见的“内容控制”方法 ...
-增加中国的省市县三级联动示例(data/shengshixian.aspx)(feedback:Blues T)。 -修正了使用IFrameUrl的Tab在切换过程中会重复加载的问题,这是一个在v2.1.6引入的问题(feedback:eroach)。 -修正了启用...
-增加中国的省市县三级联动示例(data/shengshixian.aspx)(feedback:Blues T)。 -修正了使用IFrameUrl的Tab在切换过程中会重复加载的问题,这是一个在v2.1.6引入的问题(feedback:eroach)。 -修正了启用...