-
19 Mar 2012 11:21 AM #1
[4.1 RC1] setFieldLabel on fieldcontainer error in Firefox
[4.1 RC1] setFieldLabel on fieldcontainer error in Firefox
REQUIRED INFORMATION
Ext version tested:- Ext 4.1 RC1
Browser versions tested against:- FF11.0
- IE9
- Chrome
Description:- When calling setFieldLabel on a field container in FireFox the fields overlap the label. Works fine in IE & Chrome
Test Case:
Code:Ext.onReady(function() { Ext.QuickTips.init(); var form = Ext.create('Ext.form.Panel', { renderTo: 'docbody', title : 'FieldContainers', autoHeight: true, width : 600, bodyPadding: 10, defaults: { anchor: '100%', labelWidth: 100 }, items : [{ xtype: 'fieldcontainer', fieldLabel: 'Phone', id: 'phone', combineErrors: true, msgTarget: 'under', layout: 'hbox', defaults: { hideLabel: true }, items: [ {xtype: 'displayfield', value: '('}, {xtype: 'textfield', fieldLabel: 'Phone 1', name: 'phone-1', width: 29, allowBlank: false}, {xtype: 'displayfield', value: ')'}, {xtype: 'textfield', fieldLabel: 'Phone 2', name: 'phone-2', width: 29, allowBlank: false, margins: '0 5 0 0'}, {xtype: 'displayfield', value: '-'}, {xtype: 'textfield', fieldLabel: 'Phone 3', name: 'phone-3', width: 48, allowBlank: false} ] } ] }); Ext.getCmp('phone').setFieldLabel('New Phone Label'); });
HELPFUL INFORMATION
Screenshot:
setFieldLabel_bug.jpg
-
19 Mar 2012 11:56 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,677
- Vote Rating
- 435
Thanks for the report. Also happening in FF10
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Apr 2012 5:59 AM #3
I've just run into this too. I didn't try RC1 but I've just upgraded to RC2 and this is now a problem for me.
Works OK on:
Internet Explorer 9.0.8.16421
Safari 5.1.2 (7534.52.7)
Opera 11.60 (build 1185)
Error occurs on:
Firefox 9.0.1 (Firebug 1.9.0)
Chrome 16.0.912.75m
Thanks,
Rob
-
4 Apr 2012 7:20 AM #4
Yes this bug still exists in RC2 and affects fields as well as fieldcontainers.
The solution I used is this override -
The solution is from this thread -Code:Ext.override(Ext.form.field.Base, { setFieldLabel: function($Label) { this.fieldLabel = $Label; Ext.get(this.getEl().query("label")[0]).update(this.fieldLabel+this.labelSeparator); } });
http://www.sencha.com/forum/showthre...=setFieldLabel
-
4 Apr 2012 7:24 AM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,677
- Vote Rating
- 435
Please note you should use Ext.define instead.
Code:Ext.define('Override.form.field.Base', { override : 'Ext.form.field.Base', setFieldLabel: function(label) { this.fieldLabel = label; Ext.get(this.getEl().query("label")[0]).update(label + this.labelSeparator); } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Apr 2012 8:26 AM #6
The solution I posted above no longer seems to be working for me.
Anyone have a better suggestion?
Was really hoping this bug would have been fixed in RC2.
-
4 Apr 2012 11:33 PM #7
Sorry, I made a slight mistake in my list of tested browsers. Opera and Chrome and were the wrong way round. The list should be:
Works OK on:
Internet Explorer 9.0.8.16421
Safari 5.1.2 (7534.52.7)
Chrome 16.0.912.75m
Error occurs on:
Firefox 9.0.1 (Firebug 1.9.0)
Opera 11.60 (build 1185)
I tried editing my original post but nothing happens when I click save (on Firefox and Chrome)
-
25 Apr 2012 1:31 AM #8
This appears to have been fixed in RC3.
Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.


Reply With Quote