PDA

View Full Version : Right align text inside a TextField



BostonMerlin
25 Aug 2011, 12:37 PM
I have numbers inside a textfield i want right aligned. The Sencha Touch API docs say to use the fieldCls config property. So I set that up with a class reference with a text-align:right; defined but nothing happens.

thoughts?

thanks
JB

BostonMerlin
25 Aug 2011, 12:56 PM
I have no idea why fieldCls doesn't work but i tried inputCls and it did the trick. Can anyone explain this?

Thanks

jjerome
25 Aug 2011, 1:07 PM
I think the fieldCls refers to the xtype itself. inside that field is the label and input. So I assume, since you wanted to align the text in the input you'd change the inputCls. Same applies with the labelCls. (I just realized something similar to this while working with Ext JS code). Maybe that is why it worked :)

BostonMerlin
25 Aug 2011, 1:11 PM
That makes sense. Would be nice to include samples in the api docs for this very reason. Appreciate the reply!