Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

595 lines
19 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="cls-Ext.Toolbar"></div>/**
  16. * @class Ext.Toolbar
  17. * @extends Ext.Container
  18. * <p>Basic Toolbar class. Although the <tt>{@link Ext.Container#defaultType defaultType}</tt> for Toolbar
  19. * is <tt>{@link Ext.Button button}</tt>, Toolbar elements (child items for the Toolbar container) may
  20. * be virtually any type of Component. Toolbar elements can be created explicitly via their constructors,
  21. * or implicitly via their xtypes, and can be <tt>{@link #add}</tt>ed dynamically.</p>
  22. * <p>Some items have shortcut strings for creation:</p>
  23. * <pre>
  24. <u>Shortcut</u> <u>xtype</u> <u>Class</u> <u>Description</u>
  25. '->' 'tbfill' {@link Ext.Toolbar.Fill} begin using the right-justified button container
  26. '-' 'tbseparator' {@link Ext.Toolbar.Separator} add a vertical separator bar between toolbar items
  27. ' ' 'tbspacer' {@link Ext.Toolbar.Spacer} add horiztonal space between elements
  28. * </pre>
  29. *
  30. * Example usage of various elements:
  31. * <pre><code>
  32. var tb = new Ext.Toolbar({
  33. renderTo: document.body,
  34. width: 600,
  35. height: 100,
  36. items: [
  37. {
  38. // xtype: 'button', // default for Toolbars, same as 'tbbutton'
  39. text: 'Button'
  40. },
  41. {
  42. xtype: 'splitbutton', // same as 'tbsplitbutton'
  43. text: 'Split Button'
  44. },
  45. // begin using the right-justified button container
  46. '->', // same as {xtype: 'tbfill'}, // Ext.Toolbar.Fill
  47. {
  48. xtype: 'textfield',
  49. name: 'field1',
  50. emptyText: 'enter search term'
  51. },
  52. // add a vertical separator bar between toolbar items
  53. '-', // same as {xtype: 'tbseparator'} to create Ext.Toolbar.Separator
  54. 'text 1', // same as {xtype: 'tbtext', text: 'text1'} to create Ext.Toolbar.TextItem
  55. {xtype: 'tbspacer'},// same as ' ' to create Ext.Toolbar.Spacer
  56. 'text 2',
  57. {xtype: 'tbspacer', width: 50}, // add a 50px space
  58. 'text 3'
  59. ]
  60. });
  61. * </code></pre>
  62. * Example adding a ComboBox within a menu of a button:
  63. * <pre><code>
  64. // ComboBox creation
  65. var combo = new Ext.form.ComboBox({
  66. store: new Ext.data.ArrayStore({
  67. autoDestroy: true,
  68. fields: ['initials', 'fullname'],
  69. data : [
  70. ['FF', 'Fred Flintstone'],
  71. ['BR', 'Barney Rubble']
  72. ]
  73. }),
  74. displayField: 'fullname',
  75. typeAhead: true,
  76. mode: 'local',
  77. forceSelection: true,
  78. triggerAction: 'all',
  79. emptyText: 'Select a name...',
  80. selectOnFocus: true,
  81. width: 135,
  82. getListParent: function() {
  83. return this.el.up('.x-menu');
  84. },
  85. iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
  86. });
  87. // put ComboBox in a Menu
  88. var menu = new Ext.menu.Menu({
  89. id: 'mainMenu',
  90. items: [
  91. combo // A Field in a Menu
  92. ]
  93. });
  94. // add a Button with the menu
  95. tb.add({
  96. text:'Button w/ Menu',
  97. menu: menu // assign menu by instance
  98. });
  99. tb.doLayout();
  100. * </code></pre>
  101. * @constructor
  102. * Creates a new Toolbar
  103. * @param {Object/Array} config A config object or an array of buttons to <tt>{@link #add}</tt>
  104. * @xtype toolbar
  105. */
  106. Ext.Toolbar = function(config){
  107. if(Ext.isArray(config)){
  108. config = {items: config, layout: 'toolbar'};
  109. } else {
  110. config = Ext.apply({
  111. layout: 'toolbar'
  112. }, config);
  113. if(config.buttons) {
  114. config.items = config.buttons;
  115. }
  116. }
  117. Ext.Toolbar.superclass.constructor.call(this, config);
  118. };
  119. (function(){
  120. var T = Ext.Toolbar;
  121. Ext.extend(T, Ext.Container, {
  122. defaultType: 'button',
  123. <div id="cfg-Ext.Toolbar-layout"></div>/**
  124. * @cfg {String/Object} layout
  125. * This class assigns a default layout (<code>layout:'<b>toolbar</b>'</code>).
  126. * Developers <i>may</i> override this configuration option if another layout
  127. * is required (the constructor must be passed a configuration object in this
  128. * case instead of an array).
  129. * See {@link Ext.Container#layout} for additional information.
  130. */
  131. enableOverflow : false,
  132. <div id="cfg-Ext.Toolbar-enableOverflow"></div>/**
  133. * @cfg {Boolean} enableOverflow
  134. * Defaults to false. Configure <tt>true</tt> to make the toolbar provide a button
  135. * which activates a dropdown Menu to show items which overflow the Toolbar's width.
  136. */
  137. <div id="cfg-Ext.Toolbar-buttonAlign"></div>/**
  138. * @cfg {String} buttonAlign
  139. * <p>The default position at which to align child items. Defaults to <code>"left"</code></p>
  140. * <p>May be specified as <code>"center"</code> to cause items added before a Fill (A <code>"->"</code>) item
  141. * to be centered in the Toolbar. Items added after a Fill are still right-aligned.</p>
  142. * <p>Specify as <code>"right"</code> to right align all child items.</p>
  143. */
  144. trackMenus : true,
  145. internalDefaults: {removeMode: 'container', hideParent: true},
  146. toolbarCls: 'x-toolbar',
  147. initComponent : function(){
  148. T.superclass.initComponent.call(this);
  149. <div id="event-Ext.Toolbar-overflowchange"></div>/**
  150. * @event overflowchange
  151. * Fires after the overflow state has changed.
  152. * @param {Object} c The Container
  153. * @param {Boolean} lastOverflow overflow state
  154. */
  155. this.addEvents('overflowchange');
  156. },
  157. // private
  158. onRender : function(ct, position){
  159. if(!this.el){
  160. if(!this.autoCreate){
  161. this.autoCreate = {
  162. cls: this.toolbarCls + ' x-small-editor'
  163. };
  164. }
  165. this.el = ct.createChild(Ext.apply({ id: this.id },this.autoCreate), position);
  166. Ext.Toolbar.superclass.onRender.apply(this, arguments);
  167. }
  168. },
  169. <div id="method-Ext.Toolbar-add"></div>/**
  170. * <p>Adds element(s) to the toolbar -- this function takes a variable number of
  171. * arguments of mixed type and adds them to the toolbar.</p>
  172. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  173. * @param {Mixed} arg1 The following types of arguments are all valid:<br />
  174. * <ul>
  175. * <li>{@link Ext.Button} config: A valid button config object (equivalent to {@link #addButton})</li>
  176. * <li>HtmlElement: Any standard HTML element (equivalent to {@link #addElement})</li>
  177. * <li>Field: Any form field (equivalent to {@link #addField})</li>
  178. * <li>Item: Any subclass of {@link Ext.Toolbar.Item} (equivalent to {@link #addItem})</li>
  179. * <li>String: Any generic string (gets wrapped in a {@link Ext.Toolbar.TextItem}, equivalent to {@link #addText}).
  180. * Note that there are a few special strings that are treated differently as explained next.</li>
  181. * <li>'-': Creates a separator element (equivalent to {@link #addSeparator})</li>
  182. * <li>' ': Creates a spacer element (equivalent to {@link #addSpacer})</li>
  183. * <li>'->': Creates a fill element (equivalent to {@link #addFill})</li>
  184. * </ul>
  185. * @param {Mixed} arg2
  186. * @param {Mixed} etc.
  187. * @method add
  188. */
  189. // private
  190. lookupComponent : function(c){
  191. if(Ext.isString(c)){
  192. if(c == '-'){
  193. c = new T.Separator();
  194. }else if(c == ' '){
  195. c = new T.Spacer();
  196. }else if(c == '->'){
  197. c = new T.Fill();
  198. }else{
  199. c = new T.TextItem(c);
  200. }
  201. this.applyDefaults(c);
  202. }else{
  203. if(c.isFormField || c.render){ // some kind of form field, some kind of Toolbar.Item
  204. c = this.createComponent(c);
  205. }else if(c.tag){ // DomHelper spec
  206. c = new T.Item({autoEl: c});
  207. }else if(c.tagName){ // element
  208. c = new T.Item({el:c});
  209. }else if(Ext.isObject(c)){ // must be button config?
  210. c = c.xtype ? this.createComponent(c) : this.constructButton(c);
  211. }
  212. }
  213. return c;
  214. },
  215. // private
  216. applyDefaults : function(c){
  217. if(!Ext.isString(c)){
  218. c = Ext.Toolbar.superclass.applyDefaults.call(this, c);
  219. var d = this.internalDefaults;
  220. if(c.events){
  221. Ext.applyIf(c.initialConfig, d);
  222. Ext.apply(c, d);
  223. }else{
  224. Ext.applyIf(c, d);
  225. }
  226. }
  227. return c;
  228. },
  229. <div id="method-Ext.Toolbar-addSeparator"></div>/**
  230. * Adds a separator
  231. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  232. * @return {Ext.Toolbar.Item} The separator {@link Ext.Toolbar.Item item}
  233. */
  234. addSeparator : function(){
  235. return this.add(new T.Separator());
  236. },
  237. <div id="method-Ext.Toolbar-addSpacer"></div>/**
  238. * Adds a spacer element
  239. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  240. * @return {Ext.Toolbar.Spacer} The spacer item
  241. */
  242. addSpacer : function(){
  243. return this.add(new T.Spacer());
  244. },
  245. <div id="method-Ext.Toolbar-addFill"></div>/**
  246. * Forces subsequent additions into the float:right toolbar
  247. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  248. */
  249. addFill : function(){
  250. this.add(new T.Fill());
  251. },
  252. <div id="method-Ext.Toolbar-addElement"></div>/**
  253. * Adds any standard HTML element to the toolbar
  254. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  255. * @param {Mixed} el The element or id of the element to add
  256. * @return {Ext.Toolbar.Item} The element's item
  257. */
  258. addElement : function(el){
  259. return this.addItem(new T.Item({el:el}));
  260. },
  261. <div id="method-Ext.Toolbar-addItem"></div>/**
  262. * Adds any Toolbar.Item or subclass
  263. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  264. * @param {Ext.Toolbar.Item} item
  265. * @return {Ext.Toolbar.Item} The item
  266. */
  267. addItem : function(item){
  268. return this.add.apply(this, arguments);
  269. },
  270. <div id="method-Ext.Toolbar-addButton"></div>/**
  271. * Adds a button (or buttons). See {@link Ext.Button} for more info on the config.
  272. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  273. * @param {Object/Array} config A button config or array of configs
  274. * @return {Ext.Button/Array}
  275. */
  276. addButton : function(config){
  277. if(Ext.isArray(config)){
  278. var buttons = [];
  279. for(var i = 0, len = config.length; i < len; i++) {
  280. buttons.push(this.addButton(config[i]));
  281. }
  282. return buttons;
  283. }
  284. return this.add(this.constructButton(config));
  285. },
  286. <div id="method-Ext.Toolbar-addText"></div>/**
  287. * Adds text to the toolbar
  288. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  289. * @param {String} text The text to add
  290. * @return {Ext.Toolbar.Item} The element's item
  291. */
  292. addText : function(text){
  293. return this.addItem(new T.TextItem(text));
  294. },
  295. <div id="method-Ext.Toolbar-addDom"></div>/**
  296. * Adds a new element to the toolbar from the passed {@link Ext.DomHelper} config
  297. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  298. * @param {Object} config
  299. * @return {Ext.Toolbar.Item} The element's item
  300. */
  301. addDom : function(config){
  302. return this.add(new T.Item({autoEl: config}));
  303. },
  304. <div id="method-Ext.Toolbar-addField"></div>/**
  305. * Adds a dynamically rendered Ext.form field (TextField, ComboBox, etc). Note: the field should not have
  306. * been rendered yet. For a field that has already been rendered, use {@link #addElement}.
  307. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  308. * @param {Ext.form.Field} field
  309. * @return {Ext.Toolbar.Item}
  310. */
  311. addField : function(field){
  312. return this.add(field);
  313. },
  314. <div id="method-Ext.Toolbar-insertButton"></div>/**
  315. * Inserts any {@link Ext.Toolbar.Item}/{@link Ext.Button} at the specified index.
  316. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  317. * @param {Number} index The index where the item is to be inserted
  318. * @param {Object/Ext.Toolbar.Item/Ext.Button/Array} item The button, or button config object to be
  319. * inserted, or an array of buttons/configs.
  320. * @return {Ext.Button/Item}
  321. */
  322. insertButton : function(index, item){
  323. if(Ext.isArray(item)){
  324. var buttons = [];
  325. for(var i = 0, len = item.length; i < len; i++) {
  326. buttons.push(this.insertButton(index + i, item[i]));
  327. }
  328. return buttons;
  329. }
  330. return Ext.Toolbar.superclass.insert.call(this, index, item);
  331. },
  332. // private
  333. trackMenu : function(item, remove){
  334. if(this.trackMenus && item.menu){
  335. var method = remove ? 'mun' : 'mon';
  336. this[method](item, 'menutriggerover', this.onButtonTriggerOver, this);
  337. this[method](item, 'menushow', this.onButtonMenuShow, this);
  338. this[method](item, 'menuhide', this.onButtonMenuHide, this);
  339. }
  340. },
  341. // private
  342. constructButton : function(item){
  343. var b = item.events ? item : this.createComponent(item, item.split ? 'splitbutton' : this.defaultType);
  344. return b;
  345. },
  346. // private
  347. onAdd : function(c){
  348. Ext.Toolbar.superclass.onAdd.call(this);
  349. this.trackMenu(c);
  350. if(this.disabled){
  351. c.disable();
  352. }
  353. },
  354. // private
  355. onRemove : function(c){
  356. Ext.Toolbar.superclass.onRemove.call(this);
  357. if (c == this.activeMenuBtn) {
  358. delete this.activeMenuBtn;
  359. }
  360. this.trackMenu(c, true);
  361. },
  362. // private
  363. onDisable : function(){
  364. this.items.each(function(item){
  365. if(item.disable){
  366. item.disable();
  367. }
  368. });
  369. },
  370. // private
  371. onEnable : function(){
  372. this.items.each(function(item){
  373. if(item.enable){
  374. item.enable();
  375. }
  376. });
  377. },
  378. // private
  379. onButtonTriggerOver : function(btn){
  380. if(this.activeMenuBtn && this.activeMenuBtn != btn){
  381. this.activeMenuBtn.hideMenu();
  382. btn.showMenu();
  383. this.activeMenuBtn = btn;
  384. }
  385. },
  386. // private
  387. onButtonMenuShow : function(btn){
  388. this.activeMenuBtn = btn;
  389. },
  390. // private
  391. onButtonMenuHide : function(btn){
  392. delete this.activeMenuBtn;
  393. }
  394. });
  395. Ext.reg('toolbar', Ext.Toolbar);
  396. <div id="cls-Ext.Toolbar.Item"></div>/**
  397. * @class Ext.Toolbar.Item
  398. * @extends Ext.BoxComponent
  399. * The base class that other non-interacting Toolbar Item classes should extend in order to
  400. * get some basic common toolbar item functionality.
  401. * @constructor
  402. * Creates a new Item
  403. * @param {HTMLElement} el
  404. * @xtype tbitem
  405. */
  406. T.Item = Ext.extend(Ext.BoxComponent, {
  407. hideParent: true, // Hiding a Toolbar.Item hides its containing TD
  408. enable:Ext.emptyFn,
  409. disable:Ext.emptyFn,
  410. focus:Ext.emptyFn
  411. <div id="cfg-Ext.Toolbar.Item-overflowText"></div>/**
  412. * @cfg {String} overflowText Text to be used for the menu if the item is overflowed.
  413. */
  414. });
  415. Ext.reg('tbitem', T.Item);
  416. <div id="cls-Ext.Toolbar.Separator"></div>/**
  417. * @class Ext.Toolbar.Separator
  418. * @extends Ext.Toolbar.Item
  419. * A simple class that adds a vertical separator bar between toolbar items
  420. * (css class:<tt>'xtb-sep'</tt>). Example usage:
  421. * <pre><code>
  422. new Ext.Panel({
  423. tbar : [
  424. 'Item 1',
  425. {xtype: 'tbseparator'}, // or '-'
  426. 'Item 2'
  427. ]
  428. });
  429. </code></pre>
  430. * @constructor
  431. * Creates a new Separator
  432. * @xtype tbseparator
  433. */
  434. T.Separator = Ext.extend(T.Item, {
  435. onRender : function(ct, position){
  436. this.el = ct.createChild({tag:'span', cls:'xtb-sep'}, position);
  437. }
  438. });
  439. Ext.reg('tbseparator', T.Separator);
  440. <div id="cls-Ext.Toolbar.Spacer"></div>/**
  441. * @class Ext.Toolbar.Spacer
  442. * @extends Ext.Toolbar.Item
  443. * A simple element that adds extra horizontal space between items in a toolbar.
  444. * By default a 2px wide space is added via css specification:<pre><code>
  445. .x-toolbar .xtb-spacer {
  446. width:2px;
  447. }
  448. * </code></pre>
  449. * <p>Example usage:</p>
  450. * <pre><code>
  451. new Ext.Panel({
  452. tbar : [
  453. 'Item 1',
  454. {xtype: 'tbspacer'}, // or ' '
  455. 'Item 2',
  456. // space width is also configurable via javascript
  457. {xtype: 'tbspacer', width: 50}, // add a 50px space
  458. 'Item 3'
  459. ]
  460. });
  461. </code></pre>
  462. * @constructor
  463. * Creates a new Spacer
  464. * @xtype tbspacer
  465. */
  466. T.Spacer = Ext.extend(T.Item, {
  467. <div id="cfg-Ext.Toolbar.Spacer-width"></div>/**
  468. * @cfg {Number} width
  469. * The width of the spacer in pixels (defaults to 2px via css style <tt>.x-toolbar .xtb-spacer</tt>).
  470. */
  471. onRender : function(ct, position){
  472. this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position);
  473. }
  474. });
  475. Ext.reg('tbspacer', T.Spacer);
  476. <div id="cls-Ext.Toolbar.Fill"></div>/**
  477. * @class Ext.Toolbar.Fill
  478. * @extends Ext.Toolbar.Spacer
  479. * A non-rendering placeholder item which instructs the Toolbar's Layout to begin using
  480. * the right-justified button container.
  481. * <pre><code>
  482. new Ext.Panel({
  483. tbar : [
  484. 'Item 1',
  485. {xtype: 'tbfill'}, // or '->'
  486. 'Item 2'
  487. ]
  488. });
  489. </code></pre>
  490. * @constructor
  491. * Creates a new Fill
  492. * @xtype tbfill
  493. */
  494. T.Fill = Ext.extend(T.Item, {
  495. // private
  496. render : Ext.emptyFn,
  497. isFill : true
  498. });
  499. Ext.reg('tbfill', T.Fill);
  500. <div id="cls-Ext.Toolbar.TextItem"></div>/**
  501. * @class Ext.Toolbar.TextItem
  502. * @extends Ext.Toolbar.Item
  503. * A simple class that renders text directly into a toolbar
  504. * (with css class:<tt>'xtb-text'</tt>). Example usage:
  505. * <pre><code>
  506. new Ext.Panel({
  507. tbar : [
  508. {xtype: 'tbtext', text: 'Item 1'} // or simply 'Item 1'
  509. ]
  510. });
  511. </code></pre>
  512. * @constructor
  513. * Creates a new TextItem
  514. * @param {String/Object} text A text string, or a config object containing a <tt>text</tt> property
  515. * @xtype tbtext
  516. */
  517. T.TextItem = Ext.extend(T.Item, {
  518. <div id="cfg-Ext.Toolbar.TextItem-text"></div>/**
  519. * @cfg {String} text The text to be used as innerHTML (html tags are accepted)
  520. */
  521. constructor: function(config){
  522. T.TextItem.superclass.constructor.call(this, Ext.isString(config) ? {text: config} : config);
  523. },
  524. // private
  525. onRender : function(ct, position) {
  526. this.autoEl = {cls: 'xtb-text', html: this.text || ''};
  527. T.TextItem.superclass.onRender.call(this, ct, position);
  528. },
  529. <div id="method-Ext.Toolbar.TextItem-setText"></div>/**
  530. * Updates this item's text, setting the text to be used as innerHTML.
  531. * @param {String} t The text to display (html accepted).
  532. */
  533. setText : function(t) {
  534. if(this.rendered){
  535. this.el.update(t);
  536. }else{
  537. this.text = t;
  538. }
  539. }
  540. });
  541. Ext.reg('tbtext', T.TextItem);
  542. // backwards compat
  543. T.Button = Ext.extend(Ext.Button, {});
  544. T.SplitButton = Ext.extend(Ext.SplitButton, {});
  545. Ext.reg('tbbutton', T.Button);
  546. Ext.reg('tbsplit', T.SplitButton);
  547. })();
  548. </pre>
  549. </body>
  550. </html>