Reputation: 41
How to change text dynamically on Ext.draw.Text element?
this.textLabel = Ext.create "Ext.draw.Text"
type : 'text',
text : me.curValue,
font : '24px Arial',
width : 100,
height: 30,
x : 100
y : 120
This method doesn't work:
this.textLabel.setText("new text")
How can I do that?
Upvotes: 0
Views: 2079
Reputation: 2969
I don't know if its a typo but your code should look something like this:
this.textLabel = Ext.create('Ext.draw.Text', {
type : 'text',
text : me.curValue,
font : '24px Arial',
width : 100,
height: 30,
x : 100,
y : 120
});
this.textLabel.setText("new text");
Also what does this
and me
refer to? More code would be helpful.
Anyways here is a working example: http://jsfiddle.net/6zczP/2/
Upvotes: 2