X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FToolbar.js;h=cee6171a708ab5367770506367465cb55da13218;hb=75cbc4ce04c9c01ac47671cb01320ce699128d00;hp=b6ecbd6f3ecfb2283aa1fd0dfde82ed62365b83d;hpb=f6a73718648121d3fb1a3fc7c1358f0ffb205b7f;p=roojs1 diff --git a/Roo/Toolbar.js b/Roo/Toolbar.js index b6ecbd6f3e..cee6171a70 100644 --- a/Roo/Toolbar.js +++ b/Roo/Toolbar.js @@ -11,6 +11,7 @@ /** * @class Roo.Toolbar + * @children Roo.Toolbar.Item Roo.Toolbar.Button Roo.Toolbar.SplitButton Roo.form.Field * Basic Toolbar class. * @constructor * Creates a new Toolbar @@ -52,7 +53,7 @@ Roo.Toolbar.prototype = { * @cfg {Array} items * array of button configs or elements to add (will be converted to a MixedCollection) */ - + items: false, /** * @cfg {String/HTMLElement/Element} container * The id or element that will contain the toolbar @@ -523,7 +524,7 @@ Roo.Toolbar.Fill = Roo.extend(Roo.Toolbar.Spacer, { * A simple class that renders text directly into a toolbar. * @constructor * Creates a new TextItem - * @param {String} text + * @cfg {string} text */ Roo.Toolbar.TextItem = function(cfg){ var text = cfg || ""; @@ -546,7 +547,23 @@ Roo.extend(Roo.Toolbar.TextItem, Roo.Toolbar.Item, { enable:Roo.emptyFn, disable:Roo.emptyFn, - focus:Roo.emptyFn + focus:Roo.emptyFn, + /** + * Shows this button + */ + show: function(){ + this.hidden = false; + this.el.style.display = ""; + }, + + /** + * Hides this button + */ + hide: function(){ + this.hidden = true; + this.el.style.display = "none"; + } + }); /** @@ -560,7 +577,10 @@ Roo.extend(Roo.Toolbar.TextItem, Roo.Toolbar.Item, { Roo.Toolbar.Button = function(config){ Roo.Toolbar.Button.superclass.constructor.call(this, null, config); }; -Roo.extend(Roo.Toolbar.Button, Roo.Button, { +Roo.extend(Roo.Toolbar.Button, Roo.Button, +{ + + render : function(td){ this.td = td; Roo.Toolbar.Button.superclass.render.call(this, td);