}
el.className = this.itemCls + (this.menu ? " x-menu-item-arrow" : "") + (this.cls ? " " + this.cls : "");
- var html = this.html.length ? this.html : String.format(this.text);
+ var html = this.html.length ? this.html : String.format('{0}',this.text);
el.innerHTML = String.format(
'<img src="{0}" class="x-menu-item-icon {1}" />' + html,
/**
* Sets the text to display in this menu item
* @param {String} text The text to display
+ * @param {Boolean} isHTML true to indicate text is pure html.
*/
- setText : function(text){
- this.text = text;
+ setText : function(text, isHTML){
+ if (isHTML) {
+ this.html = text;
+ } else {
+ this.text = text;
+ this.html = '';
+ }
if(this.rendered){
+ var html = this.html.length ? this.html : String.format('{0}',this.text);
+
this.el.update(String.format(
- '<img src="{0}" class="x-menu-item-icon {2}">{1}',
+ '<img src="{0}" class="x-menu-item-icon {2}">' + html,
this.icon || Roo.BLANK_IMAGE_URL, this.text, this.iconCls || ''));
this.parentMenu.autoWidth();
}