3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.layout.ToolbarLayout"></div>/**
\r
9 * @class Ext.layout.ToolbarLayout
\r
10 * @extends Ext.layout.ContainerLayout
\r
11 * Layout manager implicitly used by Ext.Toolbar.
\r
13 Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, {
\r
14 monitorResize : true,
\r
16 lastOverflow : false,
\r
18 noItemsMenuText : '<div class="x-toolbar-no-items">(None)</div>',
\r
20 onLayout : function(ct, target){
\r
22 target.addClass('x-toolbar-layout-ct');
\r
23 target.insertHtml('beforeEnd',
\r
24 '<table cellspacing="0" class="x-toolbar-ct"><tbody><tr><td class="x-toolbar-left" align="left"><table cellspacing="0"><tbody><tr class="x-toolbar-left-row"></tr></tbody></table></td><td class="x-toolbar-right" align="right"><table cellspacing="0" class="x-toolbar-right-ct"><tbody><tr><td><table cellspacing="0"><tbody><tr class="x-toolbar-right-row"></tr></tbody></table></td><td><table cellspacing="0"><tbody><tr class="x-toolbar-extras-row"></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>');
\r
25 this.leftTr = target.child('tr.x-toolbar-left-row', true);
\r
26 this.rightTr = target.child('tr.x-toolbar-right-row', true);
\r
27 this.extrasTr = target.child('tr.x-toolbar-extras-row', true);
\r
29 var side = this.leftTr;
\r
32 var items = ct.items.items;
\r
33 for(var i = 0, len = items.length, c; i < len; i++, pos++) {
\r
36 side = this.rightTr;
\r
38 }else if(!c.rendered){
\r
39 c.render(this.insertCell(c, side, pos));
\r
41 if(!c.xtbHidden && !this.isValidParent(c, side.childNodes[pos])){
\r
42 var td = this.insertCell(c, side, pos);
\r
43 td.appendChild(c.getDomPositionEl().dom);
\r
44 c.container = Ext.get(td);
\r
48 //strip extra empty cells
\r
49 this.cleanup(this.leftTr);
\r
50 this.cleanup(this.rightTr);
\r
51 this.cleanup(this.extrasTr);
\r
52 this.fitToSize(target);
\r
55 cleanup : function(row){
\r
56 var cn = row.childNodes;
\r
57 for(var i = cn.length-1, c; i >= 0 && (c = cn[i]); i--){
\r
64 insertCell : function(c, side, pos){
\r
65 var td = document.createElement('td');
\r
66 td.className='x-toolbar-cell';
\r
67 side.insertBefore(td, side.childNodes[pos]||null);
\r
71 hideItem : function(item){
\r
72 var h = (this.hiddens = this.hiddens || []);
\r
74 item.xtbHidden = true;
\r
75 item.xtbWidth = item.getDomPositionEl().dom.parentNode.offsetWidth;
\r
79 unhideItem : function(item){
\r
81 item.xtbHidden = false;
\r
82 this.hiddens.remove(item);
\r
83 if(this.hiddens.length < 1){
\r
84 delete this.hiddens;
\r
88 getItemWidth : function(c){
\r
89 return c.hidden ? (c.xtbWidth || 0) : c.getDomPositionEl().dom.parentNode.offsetWidth;
\r
92 fitToSize : function(t){
\r
93 if(this.container.enableOverflow === false){
\r
96 var w = t.dom.clientWidth;
\r
97 var lw = this.lastWidth || 0;
\r
99 var iw = t.dom.firstChild.offsetWidth;
\r
101 var clipWidth = w - this.triggerWidth;
\r
102 var hideIndex = -1;
\r
104 if(iw > w || (this.hiddens && w >= lw)){
\r
105 var i, items = this.container.items.items, len = items.length, c;
\r
107 for(i = 0; i < len; i++) {
\r
110 loopWidth += this.getItemWidth(c);
\r
111 if(loopWidth > clipWidth){
\r
117 this.unhideItem(c);
\r
125 if(!this.lastOverflow){
\r
126 this.container.fireEvent('overflowchange', this.container, true);
\r
127 this.lastOverflow = true;
\r
129 }else if(this.more){
\r
131 this.more.destroy();
\r
133 if(this.lastOverflow){
\r
134 this.container.fireEvent('overflowchange', this.container, false);
\r
135 this.lastOverflow = false;
\r
140 createMenuConfig : function(c, hideOnClick){
\r
141 var cfg = Ext.apply({}, c.initialConfig),
\r
142 group = c.toggleGroup;
\r
145 text: c.overflowText || c.text,
\r
146 iconCls: c.iconCls,
\r
149 disabled: c.disabled,
\r
150 handler: c.handler,
\r
153 hideOnClick: hideOnClick
\r
155 if(group || c.enableToggle){
\r
158 checked: c.pressed,
\r
160 checkchange: function(item, checked){
\r
172 addComponentToMenu : function(m, c){
\r
173 if(c instanceof Ext.Toolbar.Separator){
\r
175 }else if(Ext.isFunction(c.isXType)){
\r
176 if(c.isXType('splitbutton')){
\r
177 m.add(this.createMenuConfig(c, true));
\r
178 }else if(c.isXType('button')){
\r
179 m.add(this.createMenuConfig(c, !c.menu));
\r
180 }else if(c.isXType('buttongroup')){
\r
181 c.items.each(function(item){
\r
182 this.addComponentToMenu(m, item);
\r
188 clearMenu : function(){
\r
189 var m = this.moreMenu;
\r
191 this.moreMenu.items.each(function(item){
\r
198 beforeMoreShow : function(m){
\r
199 var h = this.container.items.items,
\r
203 needsSep = function(group, item){
\r
204 return group.isXType('buttongroup') && !(item instanceof Ext.Toolbar.Separator);
\r
209 for(var i = 0; i < len; i++){
\r
212 if(prev && (needsSep(c, prev) || needsSep(prev, c))){
\r
215 this.addComponentToMenu(m, c);
\r
219 // put something so the menu isn't empty
\r
220 // if no compatible items found
\r
221 if(m.items.length < 1){
\r
222 m.add(this.noItemsMenuText);
\r
226 initMore : function(){
\r
228 this.moreMenu = new Ext.menu.Menu({
\r
230 beforeshow: this.beforeMoreShow,
\r
234 this.more = new Ext.Button({
\r
235 iconCls: 'x-toolbar-more-icon',
\r
236 cls: 'x-toolbar-more',
\r
237 menu: this.moreMenu
\r
239 var td = this.insertCell(this.more, this.extrasTr, 100);
\r
240 this.more.render(td);
\r
244 destroy : function(){
\r
245 Ext.destroy(this.more, this.moreMenu);
\r
246 Ext.layout.ToolbarLayout.superclass.destroy.call(this);
\r
248 <div id="prop-Ext.layout.ToolbarLayout-activeItem"></div>/**
\r
249 * @property activeItem
\r
254 Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;
\r
256 <div id="cls-Ext.Toolbar"></div>/**
\r
257 * @class Ext.Toolbar
\r
258 * @extends Ext.Container
\r
259 * <p>Basic Toolbar class. Although the <tt>{@link Ext.Container#defaultType defaultType}</tt> for Toolbar
\r
260 * is <tt>{@link Ext.Button button}</tt>, Toolbar elements (child items for the Toolbar container) may
\r
261 * be virtually any type of Component. Toolbar elements can be created explicitly via their constructors,
\r
262 * or implicitly via their xtypes, and can be <tt>{@link #add}</tt>ed dynamically.</p>
\r
263 * <p>Some items have shortcut strings for creation:</p>
\r
265 <u>Shortcut</u> <u>xtype</u> <u>Class</u> <u>Description</u>
\r
266 '->' 'tbfill' {@link Ext.Toolbar.Fill} begin using the right-justified button container
\r
267 '-' 'tbseparator' {@link Ext.Toolbar.Separator} add a vertical separator bar between toolbar items
\r
268 ' ' 'tbspacer' {@link Ext.Toolbar.Spacer} add horiztonal space between elements
\r
271 * Example usage of various elements:
\r
273 var tb = new Ext.Toolbar({
\r
274 renderTo: document.body,
\r
279 // xtype: 'button', // default for Toolbars, same as 'tbbutton'
\r
283 xtype: 'splitbutton', // same as 'tbsplitbutton'
\r
284 text: 'Split Button'
\r
286 // begin using the right-justified button container
\r
287 '->', // same as {xtype: 'tbfill'}, // Ext.Toolbar.Fill
\r
289 xtype: 'textfield',
\r
291 emptyText: 'enter search term'
\r
293 // add a vertical separator bar between toolbar items
\r
294 '-', // same as {xtype: 'tbseparator'} to create Ext.Toolbar.Separator
\r
295 'text 1', // same as {xtype: 'tbtext', text: 'text1'} to create Ext.Toolbar.TextItem
\r
296 {xtype: 'tbspacer'},// same as ' ' to create Ext.Toolbar.Spacer
\r
298 {xtype: 'tbspacer', width: 50}, // add a 50px space
\r
303 * Example adding a ComboBox within a menu of a button:
\r
305 // ComboBox creation
\r
306 var combo = new Ext.form.ComboBox({
\r
307 store: new Ext.data.ArrayStore({
\r
309 fields: ['initials', 'fullname'],
\r
311 ['FF', 'Fred Flintstone'],
\r
312 ['BR', 'Barney Rubble']
\r
315 displayField: 'fullname',
\r
318 forceSelection: true,
\r
319 triggerAction: 'all',
\r
320 emptyText: 'Select a name...',
\r
321 selectOnFocus: true,
\r
323 getListParent: function() {
\r
324 return this.el.up('.x-menu');
\r
326 iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
\r
329 // put ComboBox in a Menu
\r
330 var menu = new Ext.menu.Menu({
\r
333 combo // A Field in a Menu
\r
337 // add a Button with the menu
\r
339 text:'Button w/ Menu',
\r
340 menu: menu // assign menu by instance
\r
345 * Creates a new Toolbar
\r
346 * @param {Object/Array} config A config object or an array of buttons to <tt>{@link #add}</tt>
\r
349 Ext.Toolbar = function(config){
\r
350 if(Ext.isArray(config)){
\r
351 config = {items: config, layout: 'toolbar'};
\r
353 config = Ext.apply({
\r
356 if(config.buttons) {
\r
357 config.items = config.buttons;
\r
360 Ext.Toolbar.superclass.constructor.call(this, config);
\r
365 var T = Ext.Toolbar;
\r
367 Ext.extend(T, Ext.Container, {
\r
369 defaultType: 'button',
\r
371 <div id="cfg-Ext.Toolbar-layout"></div>/**
\r
372 * @cfg {String/Object} layout
\r
373 * This class assigns a default layout (<code>layout:'<b>toolbar</b>'</code>).
\r
374 * Developers <i>may</i> override this configuration option if another layout
\r
375 * is required (the constructor must be passed a configuration object in this
\r
376 * case instead of an array).
\r
377 * See {@link Ext.Container#layout} for additional information.
\r
381 internalDefaults: {removeMode: 'container', hideParent: true},
\r
382 toolbarCls: 'x-toolbar',
\r
384 initComponent : function(){
\r
385 T.superclass.initComponent.call(this);
\r
387 <div id="event-Ext.Toolbar-overflowchange"></div>/**
\r
388 * @event overflowchange
\r
389 * Fires after the overflow state has changed.
\r
390 * @param {Object} c The Container
\r
391 * @param {Boolean} lastOverflow overflow state
\r
393 this.addEvents('overflowchange');
\r
397 onRender : function(ct, position){
\r
399 if(!this.autoCreate){
\r
400 this.autoCreate = {
\r
401 cls: this.toolbarCls + ' x-small-editor'
\r
404 this.el = ct.createChild(Ext.apply({ id: this.id },this.autoCreate), position);
\r
408 <div id="method-Ext.Toolbar-add"></div>/**
\r
409 * <p>Adds element(s) to the toolbar -- this function takes a variable number of
\r
410 * arguments of mixed type and adds them to the toolbar.</p>
\r
411 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
412 * @param {Mixed} arg1 The following types of arguments are all valid:<br />
\r
414 * <li>{@link Ext.Button} config: A valid button config object (equivalent to {@link #addButton})</li>
\r
415 * <li>HtmlElement: Any standard HTML element (equivalent to {@link #addElement})</li>
\r
416 * <li>Field: Any form field (equivalent to {@link #addField})</li>
\r
417 * <li>Item: Any subclass of {@link Ext.Toolbar.Item} (equivalent to {@link #addItem})</li>
\r
418 * <li>String: Any generic string (gets wrapped in a {@link Ext.Toolbar.TextItem}, equivalent to {@link #addText}).
\r
419 * Note that there are a few special strings that are treated differently as explained next.</li>
\r
420 * <li>'-': Creates a separator element (equivalent to {@link #addSeparator})</li>
\r
421 * <li>' ': Creates a spacer element (equivalent to {@link #addSpacer})</li>
\r
422 * <li>'->': Creates a fill element (equivalent to {@link #addFill})</li>
\r
424 * @param {Mixed} arg2
\r
425 * @param {Mixed} etc.
\r
430 lookupComponent : function(c){
\r
431 if(Ext.isString(c)){
\r
433 c = new T.Separator();
\r
434 }else if(c == ' '){
\r
435 c = new T.Spacer();
\r
436 }else if(c == '->'){
\r
439 c = new T.TextItem(c);
\r
441 this.applyDefaults(c);
\r
443 if(c.isFormField || c.render){ // some kind of form field, some kind of Toolbar.Item
\r
444 c = this.constructItem(c);
\r
445 }else if(c.tag){ // DomHelper spec
\r
446 c = new T.Item({autoEl: c});
\r
447 }else if(c.tagName){ // element
\r
448 c = new T.Item({el:c});
\r
449 }else if(Ext.isObject(c)){ // must be button config?
\r
450 c = c.xtype ? this.constructItem(c) : this.constructButton(c);
\r
457 applyDefaults : function(c){
\r
458 if(!Ext.isString(c)){
\r
459 c = Ext.Toolbar.superclass.applyDefaults.call(this, c);
\r
460 var d = this.internalDefaults;
\r
462 Ext.applyIf(c.initialConfig, d);
\r
472 constructItem : function(item, type){
\r
473 return Ext.create(item, type || this.defaultType);
\r
476 <div id="method-Ext.Toolbar-addSeparator"></div>/**
\r
478 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
479 * @return {Ext.Toolbar.Item} The separator {@link Ext.Toolbar.Item item}
\r
481 addSeparator : function(){
\r
482 return this.add(new T.Separator());
\r
485 <div id="method-Ext.Toolbar-addSpacer"></div>/**
\r
486 * Adds a spacer element
\r
487 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
488 * @return {Ext.Toolbar.Spacer} The spacer item
\r
490 addSpacer : function(){
\r
491 return this.add(new T.Spacer());
\r
494 <div id="method-Ext.Toolbar-addFill"></div>/**
\r
495 * Forces subsequent additions into the float:right toolbar
\r
496 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
498 addFill : function(){
\r
499 this.add(new T.Fill());
\r
502 <div id="method-Ext.Toolbar-addElement"></div>/**
\r
503 * Adds any standard HTML element to the toolbar
\r
504 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
505 * @param {Mixed} el The element or id of the element to add
\r
506 * @return {Ext.Toolbar.Item} The element's item
\r
508 addElement : function(el){
\r
509 return this.addItem(new T.Item({el:el}));
\r
512 <div id="method-Ext.Toolbar-addItem"></div>/**
\r
513 * Adds any Toolbar.Item or subclass
\r
514 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
515 * @param {Ext.Toolbar.Item} item
\r
516 * @return {Ext.Toolbar.Item} The item
\r
518 addItem : function(item){
\r
519 return Ext.Toolbar.superclass.add.apply(this, arguments);
\r
522 <div id="method-Ext.Toolbar-addButton"></div>/**
\r
523 * Adds a button (or buttons). See {@link Ext.Button} for more info on the config.
\r
524 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
525 * @param {Object/Array} config A button config or array of configs
\r
526 * @return {Ext.Button/Array}
\r
528 addButton : function(config){
\r
529 if(Ext.isArray(config)){
\r
531 for(var i = 0, len = config.length; i < len; i++) {
\r
532 buttons.push(this.addButton(config[i]));
\r
536 return this.add(this.constructButton(config));
\r
539 <div id="method-Ext.Toolbar-addText"></div>/**
\r
540 * Adds text to the toolbar
\r
541 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
542 * @param {String} text The text to add
\r
543 * @return {Ext.Toolbar.Item} The element's item
\r
545 addText : function(text){
\r
546 return this.addItem(new T.TextItem(text));
\r
549 <div id="method-Ext.Toolbar-addDom"></div>/**
\r
550 * Adds a new element to the toolbar from the passed {@link Ext.DomHelper} config
\r
551 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
552 * @param {Object} config
\r
553 * @return {Ext.Toolbar.Item} The element's item
\r
555 addDom : function(config){
\r
556 return this.add(new T.Item({autoEl: config}));
\r
559 <div id="method-Ext.Toolbar-addField"></div>/**
\r
560 * Adds a dynamically rendered Ext.form field (TextField, ComboBox, etc). Note: the field should not have
\r
561 * been rendered yet. For a field that has already been rendered, use {@link #addElement}.
\r
562 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
563 * @param {Ext.form.Field} field
\r
564 * @return {Ext.Toolbar.Item}
\r
566 addField : function(field){
\r
567 return this.add(field);
\r
570 <div id="method-Ext.Toolbar-insertButton"></div>/**
\r
571 * Inserts any {@link Ext.Toolbar.Item}/{@link Ext.Button} at the specified index.
\r
572 * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
\r
573 * @param {Number} index The index where the item is to be inserted
\r
574 * @param {Object/Ext.Toolbar.Item/Ext.Button/Array} item The button, or button config object to be
\r
575 * inserted, or an array of buttons/configs.
\r
576 * @return {Ext.Button/Item}
\r
578 insertButton : function(index, item){
\r
579 if(Ext.isArray(item)){
\r
581 for(var i = 0, len = item.length; i < len; i++) {
\r
582 buttons.push(this.insertButton(index + i, item[i]));
\r
586 return Ext.Toolbar.superclass.insert.call(this, index, item);
\r
590 initMenuTracking : function(item){
\r
591 if(this.trackMenus && item.menu){
\r
593 'menutriggerover' : this.onButtonTriggerOver,
\r
594 'menushow' : this.onButtonMenuShow,
\r
595 'menuhide' : this.onButtonMenuHide,
\r
602 constructButton : function(item){
\r
603 var b = item.events ? item : this.constructItem(item, item.split ? 'splitbutton' : this.defaultType);
\r
604 this.initMenuTracking(b);
\r
609 onDisable : function(){
\r
610 this.items.each(function(item){
\r
618 onEnable : function(){
\r
619 this.items.each(function(item){
\r
627 onButtonTriggerOver : function(btn){
\r
628 if(this.activeMenuBtn && this.activeMenuBtn != btn){
\r
629 this.activeMenuBtn.hideMenu();
\r
631 this.activeMenuBtn = btn;
\r
636 onButtonMenuShow : function(btn){
\r
637 this.activeMenuBtn = btn;
\r
641 onButtonMenuHide : function(btn){
\r
642 delete this.activeMenuBtn;
\r
645 Ext.reg('toolbar', Ext.Toolbar);
\r
647 <div id="cls-Ext.Toolbar.Item"></div>/**
\r
648 * @class Ext.Toolbar.Item
\r
649 * @extends Ext.BoxComponent
\r
650 * The base class that other non-interacting Toolbar Item classes should extend in order to
\r
651 * get some basic common toolbar item functionality.
\r
653 * Creates a new Item
\r
654 * @param {HTMLElement} el
\r
657 T.Item = Ext.extend(Ext.BoxComponent, {
\r
658 hideParent: true, // Hiding a Toolbar.Item hides its containing TD
\r
659 enable:Ext.emptyFn,
\r
660 disable:Ext.emptyFn,
\r
662 <div id="cfg-Ext.Toolbar.Item-overflowText"></div>/**
\r
663 * @cfg {String} overflowText Text to be used for the menu if the item is overflowed.
\r
666 Ext.reg('tbitem', T.Item);
\r
668 <div id="cls-Ext.Toolbar.Separator"></div>/**
\r
669 * @class Ext.Toolbar.Separator
\r
670 * @extends Ext.Toolbar.Item
\r
671 * A simple class that adds a vertical separator bar between toolbar items
\r
672 * (css class:<tt>'xtb-sep'</tt>). Example usage:
\r
677 {xtype: 'tbseparator'}, // or '-'
\r
683 * Creates a new Separator
\r
684 * @xtype tbseparator
\r
686 T.Separator = Ext.extend(T.Item, {
\r
687 onRender : function(ct, position){
\r
688 this.el = ct.createChild({tag:'span', cls:'xtb-sep'}, position);
\r
691 Ext.reg('tbseparator', T.Separator);
\r
693 <div id="cls-Ext.Toolbar.Spacer"></div>/**
\r
694 * @class Ext.Toolbar.Spacer
\r
695 * @extends Ext.Toolbar.Item
\r
696 * A simple element that adds extra horizontal space between items in a toolbar.
\r
697 * By default a 2px wide space is added via css specification:<pre><code>
\r
698 .x-toolbar .xtb-spacer {
\r
702 * <p>Example usage:</p>
\r
707 {xtype: 'tbspacer'}, // or ' '
\r
709 // space width is also configurable via javascript
\r
710 {xtype: 'tbspacer', width: 50}, // add a 50px space
\r
716 * Creates a new Spacer
\r
719 T.Spacer = Ext.extend(T.Item, {
\r
720 <div id="cfg-Ext.Toolbar.Spacer-width"></div>/**
\r
721 * @cfg {Number} width
\r
722 * The width of the spacer in pixels (defaults to 2px via css style <tt>.x-toolbar .xtb-spacer</tt>).
\r
725 onRender : function(ct, position){
\r
726 this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position);
\r
729 Ext.reg('tbspacer', T.Spacer);
\r
731 <div id="cls-Ext.Toolbar.Fill"></div>/**
\r
732 * @class Ext.Toolbar.Fill
\r
733 * @extends Ext.Toolbar.Spacer
\r
734 * A non-rendering placeholder item which instructs the Toolbar's Layout to begin using
\r
735 * the right-justified button container.
\r
740 {xtype: 'tbfill'}, // or '->'
\r
746 * Creates a new Fill
\r
749 T.Fill = Ext.extend(T.Item, {
\r
751 render : Ext.emptyFn,
\r
754 Ext.reg('tbfill', T.Fill);
\r
756 <div id="cls-Ext.Toolbar.TextItem"></div>/**
\r
757 * @class Ext.Toolbar.TextItem
\r
758 * @extends Ext.Toolbar.Item
\r
759 * A simple class that renders text directly into a toolbar
\r
760 * (with css class:<tt>'xtb-text'</tt>). Example usage:
\r
764 {xtype: 'tbtext', text: 'Item 1'} // or simply 'Item 1'
\r
769 * Creates a new TextItem
\r
770 * @param {String/Object} text A text string, or a config object containing a <tt>text</tt> property
\r
773 T.TextItem = Ext.extend(T.Item, {
\r
774 constructor: function(config){
\r
775 if (Ext.isString(config)) {
\r
776 config = { autoEl: {cls: 'xtb-text', html: config }};
\r
778 config.autoEl = {cls: 'xtb-text', html: config.text || ''};
\r
780 T.TextItem.superclass.constructor.call(this, config);
\r
782 <div id="method-Ext.Toolbar.TextItem-setText"></div>/**
\r
783 * Updates this item's text, setting the text to be used as innerHTML.
\r
784 * @param {String} t The text to display (html accepted).
\r
786 setText : function(t) {
\r
787 if (this.rendered) {
\r
788 this.el.dom.innerHTML = t;
\r
790 this.autoEl.html = t;
\r
794 Ext.reg('tbtext', T.TextItem);
\r
796 // backwards compat
\r
797 T.Button = Ext.extend(Ext.Button, {});
\r
798 T.SplitButton = Ext.extend(Ext.SplitButton, {});
\r
799 Ext.reg('tbbutton', T.Button);
\r
800 Ext.reg('tbsplit', T.SplitButton);
\r