PDA

View Full Version : How to refresh input label



PostaL2600
5 May 2011, 1:34 AM
I also put this question on Stack Overflow: http://stackoverflow.com/questions/5893377/sencha-touch-how-to-refresh-input-label/5893773

Does anyone know how to solve this ?

realjax
5 May 2011, 1:39 AM
Try targetting the label element instead.

PostaL2600
5 May 2011, 1:41 AM
And do what with the label element ? I'm afraid I don't fully understand ...

realjax
5 May 2011, 1:51 AM
yeah, that's what the API docs are for. When you read those for the select field you'll see that label is not a public property but labelEl is. Follow the docs to Ext.Element and hey presto:

musicInCarInput.labelEl.setHTML([your hmtl stuff])

PostaL2600
5 May 2011, 1:56 AM
The docs also says that the select has a doLayout() method, and that the SegmentedButton's getPressed() method return void... This labelEl I've missed, sorry.

Thank you for your answer. I'll try it right away!

realjax
5 May 2011, 2:03 AM
doLayout() says :
Force this container's layout to be recalculated. A call to this function is required after adding a new component to an already rendered container, or possibly after changing sizing/position properties of child components.

You didn't add new components, nor changed child components.

PostaL2600
5 May 2011, 2:05 AM
I know, but the problem is that I get this when I try to call doLayout() on that select:


Uncaught TypeError: Object [object Object] has no method 'doLayout'

realjax
5 May 2011, 2:12 AM
How did you call doLayout?

PostaL2600
5 May 2011, 3:55 AM
musicInCarInput.doLayout()