//数据源本地,下拉列表不分页
var status_store = new Ext.data.JsonStore({
autoLoad : true,
fields:['id', 'text' ],
data: [
{id:'1', text: '已审批'},
{id:'2', text: '未审批'},
{id:'3', text: '未通过'}
]
});
var status_combo = new Ext.form.ComboBox({
id : 'cms_status',
fieldLabel : '审批状态',
store : status_store,
hiddenName : 'id',
displayField : 'text',// 名称
valueField : 'id',// 值
mode : 'local',//本地
forceSelection : true,
triggerAction : 'all',
width : 170,
emptyText : '选择审批状态',
selectOnFocus : true
});
//数据源非本地,下拉列表不分页 图1
var xb_Combox = new Ext.form.ComboBox({
triggerAction : 'all',
forceSelection : true,
editable : false,// 不可编辑
emptyText : '请选择',
fieldLabel : '性别',
name : 'xb',
width : 180,
displayField : 'text',// 名称
valueField : 'id',// 值
hiddenName : 'xb',
store : new Ext.data.JsonStore({
autoLoad : true,
url : 'GetDic/XbDic.action?format=json',
root : 'list',
fields : ['id', 'text']
}),
listeners : {
select : function(_combo) {
if (_combo.store.getAt(0).get('id') != '') {
var _comboRecord = new Ext.data.Record.create({
name : 'id',
name : 'text'
});
_combo.store.insert(0, new _comboRecord({
id : '',
text : '请选择'
}));
}
}
}
});
//数据源非本地,下拉列表框分页 图2
var mz_Combox = new Ext.form.ComboBox({
fieldLabel : '名族',
name : 'mz',
triggerAction : 'all',
forceSelection : true,
editable : false,
pageSize : 10,
emptyText : '请选择',
displayField : 'text',// 名称
valueField : 'id',// 值
hiddenName : 'mz',//form表单提交后,后台获取值
width : 180,
listWidth : 240,
store : new Ext.data.JsonStore({
autoLoad : true,
url : 'GetDic/MzDic.action?format=json',
root : 'list',
baseParams : {
limit : 10,
start : 0
},
totalProperty : 'totalCount',
fields : ['id', 'text']
})
});
//数据源非本地,下拉列表树形结构 图3
Ext.override(Ext.tree.TreeLoader, {
processResponse : function(response, node, callback, scope) {
var json = response.responseText;
json = json.slice(json.indexOf("["), json.lastIndexOf("]")+ 1);
try {
var o = response.responseData || Ext.decode(json);
node.beginUpdate();
for (var i = 0, len = o.length; i < len; i++) {
var n = this.createNode(o[i]);
if (n) {
node.appendChild(n);
}
}
node.endUpdate();
this.runCallback(callback, scope || node, [node]);
} catch (e) {
this.handleFailure(response);
}
}
});
Ext.override(Ext.form.ComboBox, {
onViewClick : function(doFocus) {
var index = this.view.getSelectedIndexes()[0], s = this.store, r = s.getAt(index);
if (r) {
this.onSelect(r, index);
} else if (s.getCount() === 0) {
this.collapse();
}
if (doFocus !== false) {
this.el.focus();
}
}
});
var hjd_Combox_edit = new Ext.form.ComboBox({
fieldLabel : '户籍地',
emptyText : '请选择',
width : 180,// comboBox宽度
maxHeight : 320,// comboBox下拉列表框的高度
listWidth : 350,// 设置下拉框的宽度,默认和comboBoxTree的宽度相等
name : '_hjd',
store : new Ext.data.SimpleStore({
fields : [],
data : [[]]
}),
editable : false,
shadow : false,
hiddenValue : '',
// hiddenName : 'hjd',
mode : 'local',
triggerAction : 'all',
tpl : '<tpl for="."><div style="height:200px"><div id="hjdTree_edit"></div></div></tpl>',
selectedClass : '',
onSelect : Ext.emptyFn
});
var hjdTree_edit = new Ext.tree.TreePanel({
loader : new Ext.tree.TreeLoader({
dataUrl : 'GetDic/XzqhTreeDic.action?format=json'
}),
border : false,
root : new Ext.tree.AsyncTreeNode({
text : '新疆维吾尔自治区',
id : '650000',
expanded : true
})
});
hjdTree_edit.on('click', function(node) {
hjd_Combox_edit.setValue(node.text);
hjdHidden.setValue(node.id)
hjd_Combox_edit.onSelect(node.id);
hjd_Combox_edit.collapse();
});
hjd_Combox_edit.on('expand', function() {
hjdTree_edit.render('hjdTree_edit');
});
- 大小: 9.4 KB
- 大小: 18.3 KB
- 大小: 64.4 KB
分享到:
相关推荐
这里主要介绍了ExtJS常用组件的样式修改,包括工具栏样式修改、菜单样式修改、树形菜单样式修改、表格样式修改、按钮样式修改等。
extjs各种组件的详细实现及各种扩展归纳总结,包括各种grid,tree,布局,表单,ajax,弹出框等
1、Extjs3.0 常用组件介绍ppt 2、怎样安装开发利器Spket 3、Spket安装包
xtype : 'jxcombo' //配置项 jxValueField:要获取值得字段名称,默认null //公共方法 getJXValue():返回自定义字段的值,如果没有自定义字段,则等价Ext.form.Combo类的getValue()方法
漂亮的Extjs图片展示组件实例,类似于幻灯片,可直接拿去用,非常不错的哦
extjs-form组件配置参数详解 extjs各种组件说明
01.教程简介_ExtJS4.2简介_SSH2基本框架搭建 02.编写几个通用的service方法、设计数据库 03.搭建ExtJS的MVC框架 04.主界面的搭建、登录功能和菜单树的生成 05.创建菜单树、前台保存用户信息 06.菜单树响应事件、我的...
extjs入门学习,各个组件的使用,包括Observable、Observable、BoxComponent、Container、Panel、Viewport及Window...
Extjs 常用属性
实现对Ext树进行分页的组件,扩展了TreeLaoder和PagingToobar
ExtJs常用布局--layout详解实例代码: ExtJs常见的布局方式有:border、form、absolute、column、accordion、table、fit、card、anchor 另外,不常见的布局有:tab、vbox、hbox 具体使用方法可见该文件的案例代码。 ...
ExtJS日期多选组件源码 日期一般是单选,有时间有需要选择多个日期的情况,返回一个日期的数组。
extjs时间日期选择组件.
ExtJS tooltip功能组件实例
我们开发项目的时候,有的时候左边的树结点很多,虽然说有extjs有异步,但还是有结点下面有时长达500个以上,甚至更多,这个时候用分页可以解决这个问题
ExtJS 组件扩展 如何正确使用Extjs---扩展组件的两个层次
EXTJS 上传组件及示例EXTJS 上传组件及示例EXTJS 上传组件及示例
精心整理的EXTJS常用例子集...是学习EXTJS不可多得的好资料,欲下载,则从速喔!!!
extjs4.2 分页combo动态条数 源码,不懂的加群