* 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)
{
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) {
if(container){
this.render(container);
}
+ this.xitems = xitems;
Roo.each(xitems, function(b) {
this.add(b);
}, this);
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)
*/
/**
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}
*/