Roo/form/ComboBoxArray.js
[roojs1] / Roo / Toolbar.js
index 8d7de71..d429219 100644 (file)
@@ -14,7 +14,7 @@
  * Basic Toolbar class.
  * @constructor
  * Creates a new Toolbar
- * @param {Object} config The config object
+ * @param {Object} container The config object
  */ 
 Roo.Toolbar = function(container, buttons, config)
 {
@@ -27,7 +27,7 @@ Roo.Toolbar = function(container, buttons, config)
     if (typeof(container) == 'object' && container.xtype) {
         config = container;
         container = config.container;
-        buttons = config.buttons; // not really - use items!!
+        buttons = config.buttons || []; // not really - use items!!
     }
     var xitems = [];
     if (config && config.items) {
@@ -40,6 +40,7 @@ Roo.Toolbar = function(container, buttons, config)
     if(container){
         this.render(container);
     }
+    this.xitems = xitems;
     Roo.each(xitems, function(b) {
         this.add(b);
     }, this);
@@ -48,8 +49,8 @@ Roo.Toolbar = function(container, buttons, config)
 
 Roo.Toolbar.prototype = {
     /**
-     * @cfg {Roo.data.Store} items
-     * array of button configs or elements to add
+     * @cfg {Array} items
+     * array of button configs or elements to add (will be converted to a MixedCollection)
      */
     
     /**
@@ -283,8 +284,9 @@ Roo.Toolbar.prototype = {
     fields : false,
     
     /**
-     * Adds a dynamically rendered Roo.form field (TextField, ComboBox, etc). Note: the field should not have
-     * been rendered yet. For a field that has already been rendered, use {@link #addElement}.
+     * Adds a dynamically rendered Roo.form field (TextField, ComboBox, etc).
+     * Note: the field should not have been rendered yet. For a field that has already been
+     * rendered, use {@link #addElement}.
      * @param {Roo.form.Field} field
      * @return {Roo.ToolbarItem}
      */