-
5 Jun 2008 8:23 AM #1
[2.1][FIXED] Checkbox with no boxLabel aligns badly within form
[2.1][FIXED] Checkbox with no boxLabel aligns badly within form
Example showing problem:
The checkbox is misaligned, and is wrongly given by a left:-8px (given by the onResize)PHP Code:var form = function() {
return {
init : function() {
var viewport = new Ext.Viewport({
layout: "border",
items:
new Ext.form.FormPanel({
region: "center",
frame: false,
bodyStyle: "padding:5px 10px 0 10px;",
autoHeight: true,
frame: true,
id: "form-ctr",
items: [{
xtype: "fieldset",
layout: "table",
height: 400,
layoutConfig: {columns: 2},
items: [{
layout: "form",
items: [{
xtype: "textfield",
fieldLabel: "Text Area",
anchor: "98%"
}]
},{
layout: "form",
items: [{
xtype: "textfield",
fieldLabel: "Text Field",
anchor: "98%"
}]
},{
layout: "form",
items: [{
xtype: "textfield",
fieldLabel: "Text Field",
anchor: "98%"
}]
},{
layout: "form",
items: [{
xtype: "textfield",
fieldLabel: "Text Field",
anchor: "98%"
}]
},{
layout: "form",
items: [{
xtype: "textfield",
fieldLabel: "Text Field",
anchor: "98%"
}]
},{
layout: "form",
items: [{
xtype: "checkbox",
fieldLabel: "Check Box",
anchor: "0%"
}]
}]
}]
})
});
}
}
}();
Ext.onReady(function() {
form.init();
}, form);
My proposed fix is to only perform the alignTo if there is no boxLabel and no fieldLabel:
PHP Code:Ext.override(Ext.form.Checkbox, {
onResize : function(){
Ext.form.Checkbox.superclass.onResize.apply(this, arguments);
if (!this.boxLabel && !this.fieldLabel) {
this.el.alignTo(this.wrap, 'c-c');
}
}
});
-
12 Jun 2008 11:09 AM #2
Updated in SVN, thanks.
-
8 Aug 2008 6:02 AM #3
-
24 Jun 2009 12:43 AM #4
I think this issue is also in the 3.x release.
No matter where i put this override.. it doesnt work when i dont specify a fieldLabel. Yes I am using 'anchor: "0%"'
Where am I to put the code?:
PHP Code:Ext.override(Ext.form.Checkbox, {
onResize : function(){
Ext.form.Checkbox.superclass.onResize.apply(this, arguments);
if (!this.boxLabel && !this.fieldLabel) {
this.el.alignTo(this.wrap, 'c-c');
}
}
});
-
24 Jun 2009 3:41 AM #5
This has been added for 3.x as well.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
26 Mar 2011 6:40 AM #6
check box alignment
check box alignment
i jus have a box with two checkboxes.
there is no labels for fields checkbox , but there is a boxLabel beside the box .
The fields is centered and i want to be left aligned.
Please HELP !!
-
29 Mar 2011 7:59 AM #7
2 1FIXED Checkbox with no boxLabel aligns badly within form
2 1FIXED Checkbox with no boxLabel aligns badly within form
i have tried it with IE 6.0 & 7.0 as well as google chrome...
so i guess no one wlse has this problem then?


Reply With Quote
