开发者

How to update view with no model from controller in Sencha Touch?

For some views I use just a controller (no model). How do I update the view after I've made some changes to it's components. Say, I can use the setValue method on a TextField to change the 开发者_运维技巧value of the field, but there is no equivalent setLabel method. Do I have to call some method to update the view after changing the label property of a TextField component?


You could just alter the HTML of the label element.

var tf = <some text field>
tf.labelEl.setHTML('<span>NEW LABEL</span>');

There doesn't seem to be an easy way to set the label from the API they expose. But if they did, I imagine that it would look like this:

function setLabel(text){
  this.labelEl.setHTML('<span>' + text + '</span>');
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜