fix type on textitem
[roojs1] / Roo / menu / TextItem.js
index 765ed1f..4bde346 100644 (file)
  * @class Roo.menu.TextItem
  * @extends Roo.menu.BaseItem
  * Adds a static text string to a menu, usually used as either a heading or group separator.
+ * Note: old style constructor with text is still supported.
+ * 
  * @constructor
  * Creates a new TextItem
- * @param {String} text The text to display
+ * @param {Object} cfg Configuration
  */
-Roo.menu.TextItem = function(text){
-    this.text = text;
+Roo.menu.TextItem = function(cfg){
+    if (typeof(cfg) == 'string') {
+        this.text = cfg;
+    } else {
+        Roo.apply(this,cfg);
+    }
+    
     Roo.menu.TextItem.superclass.constructor.call(this);
 };
 
 Roo.extend(Roo.menu.TextItem, Roo.menu.BaseItem, {
+    /**
+     * @cfg {String} text Text to show on item.
+     */
+    text : '',
+    
     /**
      * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
      */