PDA

View Full Version : [CLOSED][3.0.0] The labelStyle properties is invalid



YYSAM
12 Jul 2009, 11:03 PM
Ext version tested:

Ext 3.0.0Adapter used:

extBrowser versions tested against:

FF3.0.11 (firebug 1.3.3 installed)Operating System:

WinXP Pro SP3Description:

The labelStyle property is invalid.Test Case:


var loginDialog = new Ext.Window({
layout : 'fit',
width : 500,
height : 300,
plain : true,
shim : false,
closable : false,
draggable : false,
buttonAlign : 'center',
resizable : false,
modal : true,
items : {
layout : 'absolute',
items : [{
xtype : 'label',
html : 'Username',
labelStyle: 'font-weight:bold;',
x : 113,
y : 110
}, , {
xtype : 'textfield',
id : 'login_username',
width : 260,
x : 111,
y : 130
}, {
xtype : 'label',
html : 'Password',
labelStyle: 'font-weight:bold;',
x : 113,
y : 160
}, {
xtype : 'textfield',
id : 'login_password',
width : 260,
x : 111,
y : 180
}],
border : false,
bodyCfg : {
cls : 'ce-Login'
}
}
});


Steps to reproduce the problem:

debug in firebug.The result that was expected:

<label id="ext-comp-1004" style="left: 113px; top: 110px;font-weight:bold;" class="x-abs-layout-item">Username</label>The result that occurs instead:

<label id="ext-comp-1004" style="left: 113px; top: 110px;" class="x-abs-layout-item">Username</label>Screenshot or Video:

Debugging already done:

Possible fix:

mystix
12 Jul 2009, 11:07 PM
please refrain from appending a status of [OPEN] to bug reports you start. thanks.

evant
12 Jul 2009, 11:15 PM
Please post more information: http://extjs.com/forum/showthread.php?t=71015

YYSAM
12 Jul 2009, 11:40 PM
please refrain from appending a status of [OPEN] to bug reports you start. thanks.

sorry the status of [open] which I post.

YYSAM
12 Jul 2009, 11:40 PM
Please post more information: http://extjs.com/forum/showthread.php?t=71015

thanks your reminder, I have updated.

Condor
12 Jul 2009, 11:56 PM
Isn't this the same bug as this one (http://extjs.com/forum/showthread.php?t=73804) (3.x) and this one (http://extjs.com/forum/showthread.php?t=48114) (2.x)?

The fix for Ext 3.x is:

Ext.override(Ext.layout.FormLayout, {
getTemplateArgs: function(field) {
var noLabelSep = !field.fieldLabel || field.hideLabel;
return {
id: field.id,
label: field.fieldLabel,
labelStyle: this.getLabelStyle(field.labelStyle),
elementStyle: this.elementStyle||'',
labelSeparator: noLabelSep ? '' : (typeof field.labelSeparator == 'undefined' ? this.labelSeparator : field.labelSeparator),
itemCls: (field.itemCls||this.container.itemCls||'') + (field.hideLabel ? ' x-hide-label' : ''),
clearCls: field.clearCls || 'x-form-clear-left'
};
}
});
(now getLabelStyle is actually used!)

evant
12 Jul 2009, 11:57 PM
Correct, I believe this has already been fixed in the trunk.

YYSAM
13 Jul 2009, 12:46 AM
Isn't this the same bug as this one (http://extjs.com/forum/showthread.php?t=73804) (3.x) and this one (http://extjs.com/forum/showthread.php?t=48114) (2.x)?

The fix for Ext 3.x is:

Ext.override(Ext.layout.FormLayout, {
getTemplateArgs: function(field) {
var noLabelSep = !field.fieldLabel || field.hideLabel;
return {
id: field.id,
label: field.fieldLabel,
labelStyle: this.getLabelStyle(field.labelStyle),
elementStyle: this.elementStyle||'',
labelSeparator: noLabelSep ? '' : (typeof field.labelSeparator == 'undefined' ? this.labelSeparator : field.labelSeparator),
itemCls: (field.itemCls||this.container.itemCls||'') + (field.hideLabel ? ' x-hide-label' : ''),
clearCls: field.clearCls || 'x-form-clear-left'
};
}
});
(now getLabelStyle is actually used!)

but I think there is still some issues about this defect, because I used "absolute" layout to do this.

YYSAM
13 Jul 2009, 12:47 AM
Correct, I believe this has already been fixed in the trunk.

I have add the patch and tested it again, it still doesn't work.:-?

evant
13 Jul 2009, 1:44 AM
Now that you posted a code sample, this isn't a bug. The labelStyle property is applied to the fieldLabel on a form field. If you want to style a label object, then just pass in a style config.

Marking this as closed.

YYSAM
13 Jul 2009, 2:48 AM
Now that you posted a code sample, this isn't a bug. The labelStyle property is applied to the fieldLabel on a form field. If you want to style a label object, then just pass in a style config.

Marking this as closed.

thanks evant? it's my mistake. :D