-
17 Nov 2011 1:21 PM #1
Ext.getCmp('someid').setValue() : styling setValue parameter
Ext.getCmp('someid').setValue() : styling setValue parameter
[RESOLVED]
Hello again,
I'm using Ext.getCmp('textfieldid').setValue('Current Locaton'); to change textfield in form panel.
I would like to simple style 'Current Location' with css markup.
Ext.getCmp('neartextfield').setValue("<div style='color:blue;'>CurrentLocation</div>"); Obviously does not work.
What could be a simple workaround?
-
17 Nov 2011 11:26 PM #2
You can apply a different css class to your textfield to make it appears with blue text color, by simply calling
where "myBlueClass" is your custom css class.Code:myTextField.addCls('myBlueClass');
Please also notice that is always better get a field by using the "getComponent()" function instead of using "getCmp()".
For istance:
where "myTextField" is your textfield "itemId".Code:myForm.getComponent('myTextField');Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
18 Nov 2011 4:54 PM #3


Reply With Quote