-
3 Jan 2009 5:24 AM #41
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
7 May 2009 1:51 AM #42
-
21 May 2009 2:22 AM #43
-
26 Aug 2009 2:42 AM #44
Code:ButtonField = Ext.extend(Ext.form.Field, { defaultAutoCreate : { tag: 'div' }, onRender: function (ct, position) { if(!this.el){ var cfg = this.getAutoCreate(); if(!cfg.name){ cfg.name = this.name || this.id; } if(this.inputType){ cfg.type = this.inputType; } this.el = ct.createChild(cfg, position); } this.button = new Ext.Button({ renderTo : this.el, text : this.text, iconCls : this.iconCls || null, handler : this.handler || Ext.emptyFn, scope : this.scope || this }) }, getValue : Ext.emptyFn, setValue : Ext.emptyFn });
This worked like a charm, example:
Thank you jgarciaCode:,items: [ new ButtonField({ text: 'mybutton' }) ,{...}]
-
29 Sep 2009 12:38 AM #45
Hello all!
I downloaded this component (thanks Radu094 for this good ideia) but after using it a little bit, I found a bug. When we disable the whole form, the button still fires the "onClick" event, even though it is disabled. For this issue I found the following solution:
Hope you find this useful.PHP Code:Ext.ux.FormButton = Ext.extend(Ext.form.Field, {
//private
initComponent: function() {
Ext.ux.FormButton.superclass.initComponent.call(this);
},
defaultAutoCreate: {
tag: 'div'
},
onRender: function (ct, position) {
if(!this.el){
var cfg = this.getAutoCreate();
if (!cfg.name) { cfg.name = this.name || this.id; }
if (this.inputType) { cfg.type = this.inputType; }
this.el = ct.createChild(cfg, position);
//Undefined dom value bug fix
this.el.dom.value = '';
}
this.button = new Ext.Button({
renderTo : this.el,
text : this.text,
iconCls : this.iconCls || null,
tooltip : this.tooltip,
minWidth : this.minWidth,
maxWidth : this.maxWidth,
handler : this.handler || Ext.emptyFn,
action : this.handler || Ext.emptyFn,
scope : this.scope
});
},
onDisable: function() {
Ext.ux.FormButton.superclass.onDisable.call(this);
this.button.disable();
this.button.scope = this;
this.button.handler = Ext.emptyFn;
},
onEnable: function() {
Ext.ux.FormButton.superclass.onEnable.call(this);
this.button.enable();
this.button.scope = this;
this.button.handler = this.button.action;
},
reset: Ext.emptyFn,
getValue : Ext.emptyFn,
setValue : Ext.emptyFn
});
Regards,
André.André Rosa,
ExtJS 2.3 / Javascript Enthusiast.
-
1 Aug 2011 10:39 PM #46
thanks a lot.
i think Extjs should include Ext.form.Button in the future.
this is a common requirement, isn't it?
Ext.Button is not an <input> tag in html so this should be a standard component ...
another issue is that we can not use it in Ext designer ...
but that doesn't matter ...
-
30 May 2012 9:19 AM #47
how to remove the default LabelSeparator(:)
how to remove the default LabelSeparator(:)
how to remove the default LabelSeparator(




Reply With Quote