From: Alan Knowles Date: Mon, 16 Aug 2010 08:46:28 +0000 (+0800) Subject: Roo/menu/Item.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=8cf10dc709b70d813dca356e1259159b9220e8cc Roo/menu/Item.js --- diff --git a/Roo/menu/Item.js b/Roo/menu/Item.js index 4014bde5a3..0fe29a52d4 100644 --- a/Roo/menu/Item.js +++ b/Roo/menu/Item.js @@ -31,6 +31,11 @@ Roo.extend(Roo.menu.Item, Roo.menu.BaseItem, { * The text to show on the menu item. */ text: '', + /** + * @cfg {String} HTML to render in menu + * The text to show on the menu item (HTML version). + */ + html: '', /** * @cfg {String} icon * The path to an icon to display in this menu item (defaults to Roo.BLANK_IMAGE_URL) @@ -64,9 +69,12 @@ Roo.extend(Roo.menu.Item, Roo.menu.BaseItem, { el.target = this.hrefTarget; } 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); + el.innerHTML = String.format( - '{1}', - this.icon || Roo.BLANK_IMAGE_URL, this.text, this.iconCls || ''); + '' + html, + this.icon || Roo.BLANK_IMAGE_URL, this.iconCls || ''); this.el = el; Roo.menu.Item.superclass.onRender.call(this, container, position); },