wm003
6 May 2008, 10:57 PM
Unfortunately a TextItem in a Menu has no setText-method to comfortably change the Text at runtime (like you can with Ext.Menu.Item), so i simply added this functionality:
if(Ext.menu){
Ext.apply(Ext.menu.TextItem.prototype, {
setText : function(text){
this.text = text;
if(this.rendered){
this.el.update(text);
this.parentMenu.autoWidth();
}
}
});
}
if(Ext.menu){
Ext.apply(Ext.menu.TextItem.prototype, {
setText : function(text){
this.text = text;
if(this.rendered){
this.el.update(text);
this.parentMenu.autoWidth();
}
}
});
}