PDA

View Full Version : Problem with use afterLabelTpl



sdd0
16 Apr 2014, 1:25 AM
Hi all
When I use 'afterLabelTpl' to add a text in a label, the suffix text we added will show in next line, liks this
48733


{ xtype:'zycombo',
itemId: 'property',
store : [['internal', 'internal'], ['external', 'external'], ['general', 'general']],
fieldLabel:_T('_ifEdit','_Interface_Type'),
afterLabelTpl: '('+_T('_VoipAlg','_seconds')+')',
labelWidth:120
}


Does anyone know what wrong with me??

mdnaveed42
16 Apr 2014, 2:34 AM
Yes, this seems to be not working in 4.x version but working well in 5.x version(beta).

Created a working fiddle for you, check here (https://fiddle.sencha.com/fiddle/54t) using 4.2

Use afterLabelTextTpl (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.Labelable-cfg-afterLabelTextTpl) and also increase the labelWidth (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.Labelable-cfg-labelWidth).


T (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.ComboBox-cfg-afterLabelTextTpl)hanks,
Md Naveed,
\m/

sdd0
16 Apr 2014, 7:08 PM
HI mdnaveed42 (http://www.sencha.com/forum/member.php?293678-mdnaveed42)

Thanks for your reply!!!
But we want the suffix text at the rearmost, so should we use "afterLabelTpl" not "afterLabelTextTpl", right ??

we want like this :

48742

not this:

48743

do you have any answer for me?? :(( Thanks a lot!!!

mdnaveed42
17 Apr 2014, 2:47 AM
Your requirement cannot be served with "afterLabelTpl (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.Labelable-cfg-afterLabelTpl)" or "afterLabelTextTpl (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.Labelable-cfg-afterLabelTextTpl)"

mdnaveed42
17 Apr 2014, 3:06 AM
Click here (https://fiddle.sencha.com/fiddle/54t) to check the updated fiddle.

sdd0
17 Apr 2014, 5:07 PM
Thanks for your answer!!!!! :)

But we want to know is any 'Config options' can achieve our goal ? Like 'afterSubTpl (http://cdn.sencha.com/ext/beta/4.2.0.489/docs/index.html#!/api/Ext.form.Labelable-cfg-afterSubTpl)'.......

So far, we try successfully only in textfield. In combobox we don't know how to do.

sdd0
20 Apr 2014, 7:33 PM
Hi Md Naveed,
We really confuse with this problem!!!!:((
Because in our system we used suffix text frequently. So we really want to know this solution .
In ExtJs 2.0, we use :


this.el.insertSibling({tag: 'span', cls:'suffixtext3', html: this.suffix}, 'after');

And in our page , we just add a config option "suffix" .

{ xtype:'combo',
itemId: 'property',
inote: _T('_inote','_Iface_Type'),
width:300,
suffix: '(seconds)'
labelWidth:120,
store : [['internal', 'internal'], ['external', 'external'], ['general', 'general']],
fieldLabel:_T('_ifEdit','_Interface_Type')


}

In ExtJs 4.2 we use this method similarly, but it will display in next line. Referred to above mentioned, ExtJs 5 can solve this problem. Do you what is it fixed in ExtJs 5 ?? Can we fixed it by ourselves ??

Thanks.