如何在Ext.draw.Text元素上动态更改文本?
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")
我怎样才能做到这一点?
我不知道它是否是一个错字,但你的代码应该是这样的:
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");
还有this
和me
所指的是什么?更多代码会有所帮助。无论如何这里是一个工作的例子:http://jsfiddle.net/6zczP/2/