PDA

View Full Version : [FIXED] viewModel binding and fieldLabel, causing wrong message aligment



SebastienMorin
5 May 2014, 9:41 AM
Hello,

As the title say, i am using a viewModel with dynamically loaded data for my forms labels.
The binding is working fine, but if i have a error message to display, the alignment of my message is wrong.

Here is my fiddle: https://fiddle.sencha.com/#fiddle/5jp

Comment/uncomment the labelAlign line, to see the bug.

mitchellsimoens
6 May 2014, 4:19 AM
Thanks for the report! I have opened a bug in our bug tracker.

Phil Guerrant
3 Jun 2014, 2:37 PM
The issue has been fixed. Here's an override to get you by for now.



Ext.define('EXTJS-13303', {
override: 'Ext.form.Labelable',

setFieldLabel: function(label){
label = label || '';

var me = this,
separator = me.labelSeparator,
labelEl = me.labelEl,
errorWrapEl = me.errorWrapEl,
sideLabel = (me.labelAlign !== 'top'),
errorWrapUnderSideLabelCls = me.errorWrapUnderSideLabelCls;

me.fieldLabel = label;
if (me.rendered) {
if (Ext.isEmpty(label) && me.hideEmptyLabel) {
labelEl.setDisplayed('none');
if (sideLabel && errorWrapEl) {
errorWrapEl.removeCls(errorWrapUnderSideLabelCls);
}
} else {
if (separator) {
label = me.trimLabelSeparator() + '<span role="separator">' +
separator + '</span>';
}
labelEl.first().setHtml(label);
labelEl.setDisplayed('');
if (sideLabel && errorWrapEl) {
errorWrapEl.addCls(errorWrapUnderSideLabelCls);
}
}
me.updateLayout();
}
}
});