Ext.ns("Dma.common");
Dma.common.DmaCommon = Ext.extend(Ext.form.ComboBox, {
check : true,
displayValue : false,
displayAll:true,
valueText : [],
displayText : [],
separator : ',',
hiddenValue : '',
flag : 0,
selectAllTxt : 'SELECT ALL',
hasSelectAll : false,
initComponent : function() {
if (this.check) {
this.tpl = ''
+ '<tpl for=".">'
+ '<div class="x-combo-list-item">'
+ '<input class="x-form-check-wrap" style="border:none;background:none;" type="checkbox" name="combox" {[values.'
+ this.checkField + '?"checked":""' + ']}/>{'
+ this.displayField + '}</div></tpl>';
} else {
this.tpl = '<tpl for="."><div class="x-combo-list-item">{'
+ this.displayField + '}</div></tpl>';
}
Dma.common.DmaCommon.superclass.initComponent.apply(this, arguments);
this.onLoad = this.onLoad.createSequence(function() {
if (this.el) {
var v = this.el.dom.value;
this.el.dom.value = '';
this.el.dom.value = v;
}
});
},
getCheckValue : function() {
if (this.check) {
var rst = [];
var snapshot = this.store.snapshot || this.store.data;
var f = false;
snapshot.each(function(r) {
if (r.get(this.checkField)) {
if (r.get(this.displayField) != this.selectAllTxt) {
rst.push(r.get(this.valueField));
}
} else if(r.get(this.displayField) != this.selectAllTxt){
f = true;
}
}, this);
if(f)
this.hasSelectAll = false;
else
this.hasSelectAll = true;
var temp = rst.join(this.separator);
this.hiddenValue = temp;
return temp;
} else {
this.hiddenValue = this.getValue();
return this.hiddenValue;
}
},
getCheckDisplay : function() {
if (this.check) {
var rst = [];
var val = [];
var snapshot = this.store.snapshot || this.store.data;
var f = false;
snapshot.each(function(r) {
if (r.get(this.checkField)) {
if (r.get(this.displayField) != this.selectAllTxt) {
rst.push(r.get(this.displayField));
val.push(r.get(this.valueField));
}
} else if(r.get(this.displayField) != this.selectAllTxt){
f = true;
}
}, this);
if(f)
this.hasSelectAll = false;
else
this.hasSelectAll = true;
this.hiddenValue = val.join(this.separator);
var temp = rst.join(this.separator);
//this.setRawValue(temp);
return temp;
} else {
this.hiddenValue = this.getValue();
return this.getValue();
}
},
分享到:
相关推荐
ext,ext combobox,ext二级联动,ext combobox二级联动 ___本人的原则:上传好东西,但绝不便宜.因为自己的心血 ext combobox二级联动,ext ,ext combobox,combobox,combobox二级联动,ext 二级联动 groupCombo.on('...
NULL 博文链接:https://dengli19881102.iteye.com/blog/1046190
NULL 博文链接:https://tianhengbao.iteye.com/blog/816208
全部代码 注意路径 博文链接:https://avs110.iteye.com/blog/1156428
NULL 博文链接:https://zhcl321.iteye.com/blog/1317526
NULL 博文链接:https://yangming103.iteye.com/blog/967492
该资源是war包,里面包括ComboBox中的各个参数, 详细讲解在我的文档中有
前台: 代码如下: var provinceStore = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: basePath + “/stationManage/station... //选择省市 var provinceIDadd = new Ext.form.ComboBox({ anchor : ‘98%
NULL 博文链接:https://dengli19881102.iteye.com/blog/904770
用Ext 2.0 combobox 做的省份和城市联动选择框的例程
用EXT来实现下拉框ComboBox 下拉框可以实现分页
ext关于form表单和combobox的例子
基于Ext3.4的一个扩展Combobox组件
Ext中的Combobox下来框在EditGrid中的应用。Combobox显示值问题得以解决。
用Ext 2_0 combobox 做的省份和城市联动选择框 DOJO中国