EXTJS3 简易下拉框 easyCombo
EXTJS 简易下拉框 easyCombo
一个自己拓展的简单下拉框
/**
*简易下拉框
*/
Ext.ux.EasyCombo = Ext.extend(Ext.form.ComboBox, {
initComponent: function() {
this.readOnly = true;
this.displayField = 'mc';
this.valueField = 'id';
this.triggerAction = 'all';
this.mode=this.mode;
this.store=this.store;
this.forceSelection= true;
this.editable=false;
this.emptyText='请选择...';
Ext.ux.EasyCombo.superclass.initComponent.call(this);
}
});
Ext.reg('easyCombo', Ext.ux.EasyCombo);
前台调用:
,{
xtype:'easyCombo',
fieldLabel: '<span style="color:red;">* </span>收费方式',
hiddenName:'payModeNo',
allowBlank:false,
store : payModeNoStore,
value: 11,
mode: 'local'
}
楼主能不能附件加上截图了。这样子新手也不知道这段代码到底是用来干什么的
你的继承没意义
fieldLabel: '* 收费方式' 掺杂html代码,没有统一风格 用样式代替 itemCls:"required", allowBlank:false,
楼主最好去看看this是干嘛用的
一个有用的继续应该像下面这样写 Ext.example.MyCombo = Ext.extend(Ext.form.ComboBox, { constructor:function(config){ config=config||{}; Ext.apply(this,config); var c={ //继承后,新对象的一些默认配置 }; Ext.example.MyCombo.superclass.constructor.call(this,c); }, myFn:function(){ //新对象的一些新方法 } });
如果不是非常常用,不必添加到自定义xtype,直接new即可,如: var combo = new Ext.example.MyCombo({ //一些必要的配置,如id项 });
这个,靠,晕死,这个叫简易.....
太死板了, 至少留个fields可以自订吧, store就别要了
和2L一样没看出哪里简易了
你这种应该算是特定功能下的扩展吧
没看出比原生的combo简易到哪去。。。。。