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.

1215 lines
39 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. /**
  8. * @class Ext.Toolbar
  9. * @extends Ext.Container
  10. * <p>Basic Toolbar class. Although the <tt>{@link Ext.Container#defaultType defaultType}</tt> for Toolbar
  11. * is <tt>{@link Ext.Button button}</tt>, Toolbar elements (child items for the Toolbar container) may
  12. * be virtually any type of Component. Toolbar elements can be created explicitly via their constructors,
  13. * or implicitly via their xtypes, and can be <tt>{@link #add}</tt>ed dynamically.</p>
  14. * <p>Some items have shortcut strings for creation:</p>
  15. * <pre>
  16. <u>Shortcut</u> <u>xtype</u> <u>Class</u> <u>Description</u>
  17. '->' 'tbfill' {@link Ext.Toolbar.Fill} begin using the right-justified button container
  18. '-' 'tbseparator' {@link Ext.Toolbar.Separator} add a vertical separator bar between toolbar items
  19. ' ' 'tbspacer' {@link Ext.Toolbar.Spacer} add horiztonal space between elements
  20. * </pre>
  21. *
  22. * Example usage of various elements:
  23. * <pre><code>
  24. var tb = new Ext.Toolbar({
  25. renderTo: document.body,
  26. width: 600,
  27. height: 100,
  28. items: [
  29. {
  30. // xtype: 'button', // default for Toolbars, same as 'tbbutton'
  31. text: 'Button'
  32. },
  33. {
  34. xtype: 'splitbutton', // same as 'tbsplitbutton'
  35. text: 'Split Button'
  36. },
  37. // begin using the right-justified button container
  38. '->', // same as {xtype: 'tbfill'}, // Ext.Toolbar.Fill
  39. {
  40. xtype: 'textfield',
  41. name: 'field1',
  42. emptyText: 'enter search term'
  43. },
  44. // add a vertical separator bar between toolbar items
  45. '-', // same as {xtype: 'tbseparator'} to create Ext.Toolbar.Separator
  46. 'text 1', // same as {xtype: 'tbtext', text: 'text1'} to create Ext.Toolbar.TextItem
  47. {xtype: 'tbspacer'},// same as ' ' to create Ext.Toolbar.Spacer
  48. 'text 2',
  49. {xtype: 'tbspacer', width: 50}, // add a 50px space
  50. 'text 3'
  51. ]
  52. });
  53. * </code></pre>
  54. * Example adding a ComboBox within a menu of a button:
  55. * <pre><code>
  56. // ComboBox creation
  57. var combo = new Ext.form.ComboBox({
  58. store: new Ext.data.ArrayStore({
  59. autoDestroy: true,
  60. fields: ['initials', 'fullname'],
  61. data : [
  62. ['FF', 'Fred Flintstone'],
  63. ['BR', 'Barney Rubble']
  64. ]
  65. }),
  66. displayField: 'fullname',
  67. typeAhead: true,
  68. mode: 'local',
  69. forceSelection: true,
  70. triggerAction: 'all',
  71. emptyText: 'Select a name...',
  72. selectOnFocus: true,
  73. width: 135,
  74. getListParent: function() {
  75. return this.el.up('.x-menu');
  76. },
  77. iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
  78. });
  79. // put ComboBox in a Menu
  80. var menu = new Ext.menu.Menu({
  81. id: 'mainMenu',
  82. items: [
  83. combo // A Field in a Menu
  84. ]
  85. });
  86. // add a Button with the menu
  87. tb.add({
  88. text:'Button w/ Menu',
  89. menu: menu // assign menu by instance
  90. });
  91. tb.doLayout();
  92. * </code></pre>
  93. * @constructor
  94. * Creates a new Toolbar
  95. * @param {Object/Array} config A config object or an array of buttons to <tt>{@link #add}</tt>
  96. * @xtype toolbar
  97. */
  98. Ext.Toolbar = function(config){
  99. if(Ext.isArray(config)){
  100. config = {items: config, layout: 'toolbar'};
  101. } else {
  102. config = Ext.apply({
  103. layout: 'toolbar'
  104. }, config);
  105. if(config.buttons) {
  106. config.items = config.buttons;
  107. }
  108. }
  109. Ext.Toolbar.superclass.constructor.call(this, config);
  110. };
  111. (function(){
  112. var T = Ext.Toolbar;
  113. Ext.extend(T, Ext.Container, {
  114. defaultType: 'button',
  115. /**
  116. * @cfg {String/Object} layout
  117. * This class assigns a default layout (<code>layout:'<b>toolbar</b>'</code>).
  118. * Developers <i>may</i> override this configuration option if another layout
  119. * is required (the constructor must be passed a configuration object in this
  120. * case instead of an array).
  121. * See {@link Ext.Container#layout} for additional information.
  122. */
  123. enableOverflow : false,
  124. /**
  125. * @cfg {Boolean} enableOverflow
  126. * Defaults to false. Configure <tt>true</tt> to make the toolbar provide a button
  127. * which activates a dropdown Menu to show items which overflow the Toolbar's width.
  128. */
  129. /**
  130. * @cfg {String} buttonAlign
  131. * <p>The default position at which to align child items. Defaults to <code>"left"</code></p>
  132. * <p>May be specified as <code>"center"</code> to cause items added before a Fill (A <code>"->"</code>) item
  133. * to be centered in the Toolbar. Items added after a Fill are still right-aligned.</p>
  134. * <p>Specify as <code>"right"</code> to right align all child items.</p>
  135. */
  136. trackMenus : true,
  137. internalDefaults: {removeMode: 'container', hideParent: true},
  138. toolbarCls: 'x-toolbar',
  139. initComponent : function(){
  140. T.superclass.initComponent.call(this);
  141. /**
  142. * @event overflowchange
  143. * Fires after the overflow state has changed.
  144. * @param {Object} c The Container
  145. * @param {Boolean} lastOverflow overflow state
  146. */
  147. this.addEvents('overflowchange');
  148. },
  149. // private
  150. onRender : function(ct, position){
  151. if(!this.el){
  152. if(!this.autoCreate){
  153. this.autoCreate = {
  154. cls: this.toolbarCls + ' x-small-editor'
  155. };
  156. }
  157. this.el = ct.createChild(Ext.apply({ id: this.id },this.autoCreate), position);
  158. Ext.Toolbar.superclass.onRender.apply(this, arguments);
  159. }
  160. },
  161. /**
  162. * <p>Adds element(s) to the toolbar -- this function takes a variable number of
  163. * arguments of mixed type and adds them to the toolbar.</p>
  164. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  165. * @param {Mixed} arg1 The following types of arguments are all valid:<br />
  166. * <ul>
  167. * <li>{@link Ext.Button} config: A valid button config object (equivalent to {@link #addButton})</li>
  168. * <li>HtmlElement: Any standard HTML element (equivalent to {@link #addElement})</li>
  169. * <li>Field: Any form field (equivalent to {@link #addField})</li>
  170. * <li>Item: Any subclass of {@link Ext.Toolbar.Item} (equivalent to {@link #addItem})</li>
  171. * <li>String: Any generic string (gets wrapped in a {@link Ext.Toolbar.TextItem}, equivalent to {@link #addText}).
  172. * Note that there are a few special strings that are treated differently as explained next.</li>
  173. * <li>'-': Creates a separator element (equivalent to {@link #addSeparator})</li>
  174. * <li>' ': Creates a spacer element (equivalent to {@link #addSpacer})</li>
  175. * <li>'->': Creates a fill element (equivalent to {@link #addFill})</li>
  176. * </ul>
  177. * @param {Mixed} arg2
  178. * @param {Mixed} etc.
  179. * @method add
  180. */
  181. // private
  182. lookupComponent : function(c){
  183. if(Ext.isString(c)){
  184. if(c == '-'){
  185. c = new T.Separator();
  186. }else if(c == ' '){
  187. c = new T.Spacer();
  188. }else if(c == '->'){
  189. c = new T.Fill();
  190. }else{
  191. c = new T.TextItem(c);
  192. }
  193. this.applyDefaults(c);
  194. }else{
  195. if(c.isFormField || c.render){ // some kind of form field, some kind of Toolbar.Item
  196. c = this.createComponent(c);
  197. }else if(c.tag){ // DomHelper spec
  198. c = new T.Item({autoEl: c});
  199. }else if(c.tagName){ // element
  200. c = new T.Item({el:c});
  201. }else if(Ext.isObject(c)){ // must be button config?
  202. c = c.xtype ? this.createComponent(c) : this.constructButton(c);
  203. }
  204. }
  205. return c;
  206. },
  207. // private
  208. applyDefaults : function(c){
  209. if(!Ext.isString(c)){
  210. c = Ext.Toolbar.superclass.applyDefaults.call(this, c);
  211. var d = this.internalDefaults;
  212. if(c.events){
  213. Ext.applyIf(c.initialConfig, d);
  214. Ext.apply(c, d);
  215. }else{
  216. Ext.applyIf(c, d);
  217. }
  218. }
  219. return c;
  220. },
  221. /**
  222. * Adds a separator
  223. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  224. * @return {Ext.Toolbar.Item} The separator {@link Ext.Toolbar.Item item}
  225. */
  226. addSeparator : function(){
  227. return this.add(new T.Separator());
  228. },
  229. /**
  230. * Adds a spacer element
  231. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  232. * @return {Ext.Toolbar.Spacer} The spacer item
  233. */
  234. addSpacer : function(){
  235. return this.add(new T.Spacer());
  236. },
  237. /**
  238. * Forces subsequent additions into the float:right toolbar
  239. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  240. */
  241. addFill : function(){
  242. this.add(new T.Fill());
  243. },
  244. /**
  245. * Adds any standard HTML element to the toolbar
  246. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  247. * @param {Mixed} el The element or id of the element to add
  248. * @return {Ext.Toolbar.Item} The element's item
  249. */
  250. addElement : function(el){
  251. return this.addItem(new T.Item({el:el}));
  252. },
  253. /**
  254. * Adds any Toolbar.Item or subclass
  255. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  256. * @param {Ext.Toolbar.Item} item
  257. * @return {Ext.Toolbar.Item} The item
  258. */
  259. addItem : function(item){
  260. return this.add.apply(this, arguments);
  261. },
  262. /**
  263. * Adds a button (or buttons). See {@link Ext.Button} for more info on the config.
  264. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  265. * @param {Object/Array} config A button config or array of configs
  266. * @return {Ext.Button/Array}
  267. */
  268. addButton : function(config){
  269. if(Ext.isArray(config)){
  270. var buttons = [];
  271. for(var i = 0, len = config.length; i < len; i++) {
  272. buttons.push(this.addButton(config[i]));
  273. }
  274. return buttons;
  275. }
  276. return this.add(this.constructButton(config));
  277. },
  278. /**
  279. * Adds text to the toolbar
  280. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  281. * @param {String} text The text to add
  282. * @return {Ext.Toolbar.Item} The element's item
  283. */
  284. addText : function(text){
  285. return this.addItem(new T.TextItem(text));
  286. },
  287. /**
  288. * Adds a new element to the toolbar from the passed {@link Ext.DomHelper} config
  289. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  290. * @param {Object} config
  291. * @return {Ext.Toolbar.Item} The element's item
  292. */
  293. addDom : function(config){
  294. return this.add(new T.Item({autoEl: config}));
  295. },
  296. /**
  297. * Adds a dynamically rendered Ext.form field (TextField, ComboBox, etc). Note: the field should not have
  298. * been rendered yet. For a field that has already been rendered, use {@link #addElement}.
  299. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  300. * @param {Ext.form.Field} field
  301. * @return {Ext.Toolbar.Item}
  302. */
  303. addField : function(field){
  304. return this.add(field);
  305. },
  306. /**
  307. * Inserts any {@link Ext.Toolbar.Item}/{@link Ext.Button} at the specified index.
  308. * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
  309. * @param {Number} index The index where the item is to be inserted
  310. * @param {Object/Ext.Toolbar.Item/Ext.Button/Array} item The button, or button config object to be
  311. * inserted, or an array of buttons/configs.
  312. * @return {Ext.Button/Item}
  313. */
  314. insertButton : function(index, item){
  315. if(Ext.isArray(item)){
  316. var buttons = [];
  317. for(var i = 0, len = item.length; i < len; i++) {
  318. buttons.push(this.insertButton(index + i, item[i]));
  319. }
  320. return buttons;
  321. }
  322. return Ext.Toolbar.superclass.insert.call(this, index, item);
  323. },
  324. // private
  325. trackMenu : function(item, remove){
  326. if(this.trackMenus && item.menu){
  327. var method = remove ? 'mun' : 'mon';
  328. this[method](item, 'menutriggerover', this.onButtonTriggerOver, this);
  329. this[method](item, 'menushow', this.onButtonMenuShow, this);
  330. this[method](item, 'menuhide', this.onButtonMenuHide, this);
  331. }
  332. },
  333. // private
  334. constructButton : function(item){
  335. var b = item.events ? item : this.createComponent(item, item.split ? 'splitbutton' : this.defaultType);
  336. return b;
  337. },
  338. // private
  339. onAdd : function(c){
  340. Ext.Toolbar.superclass.onAdd.call(this);
  341. this.trackMenu(c);
  342. if(this.disabled){
  343. c.disable();
  344. }
  345. },
  346. // private
  347. onRemove : function(c){
  348. Ext.Toolbar.superclass.onRemove.call(this);
  349. if (c == this.activeMenuBtn) {
  350. delete this.activeMenuBtn;
  351. }
  352. this.trackMenu(c, true);
  353. },
  354. // private
  355. onDisable : function(){
  356. this.items.each(function(item){
  357. if(item.disable){
  358. item.disable();
  359. }
  360. });
  361. },
  362. // private
  363. onEnable : function(){
  364. this.items.each(function(item){
  365. if(item.enable){
  366. item.enable();
  367. }
  368. });
  369. },
  370. // private
  371. onButtonTriggerOver : function(btn){
  372. if(this.activeMenuBtn && this.activeMenuBtn != btn){
  373. this.activeMenuBtn.hideMenu();
  374. btn.showMenu();
  375. this.activeMenuBtn = btn;
  376. }
  377. },
  378. // private
  379. onButtonMenuShow : function(btn){
  380. this.activeMenuBtn = btn;
  381. },
  382. // private
  383. onButtonMenuHide : function(btn){
  384. delete this.activeMenuBtn;
  385. }
  386. });
  387. Ext.reg('toolbar', Ext.Toolbar);
  388. /**
  389. * @class Ext.Toolbar.Item
  390. * @extends Ext.BoxComponent
  391. * The base class that other non-interacting Toolbar Item classes should extend in order to
  392. * get some basic common toolbar item functionality.
  393. * @constructor
  394. * Creates a new Item
  395. * @param {HTMLElement} el
  396. * @xtype tbitem
  397. */
  398. T.Item = Ext.extend(Ext.BoxComponent, {
  399. hideParent: true, // Hiding a Toolbar.Item hides its containing TD
  400. enable:Ext.emptyFn,
  401. disable:Ext.emptyFn,
  402. focus:Ext.emptyFn
  403. /**
  404. * @cfg {String} overflowText Text to be used for the menu if the item is overflowed.
  405. */
  406. });
  407. Ext.reg('tbitem', T.Item);
  408. /**
  409. * @class Ext.Toolbar.Separator
  410. * @extends Ext.Toolbar.Item
  411. * A simple class that adds a vertical separator bar between toolbar items
  412. * (css class:<tt>'xtb-sep'</tt>). Example usage:
  413. * <pre><code>
  414. new Ext.Panel({
  415. tbar : [
  416. 'Item 1',
  417. {xtype: 'tbseparator'}, // or '-'
  418. 'Item 2'
  419. ]
  420. });
  421. </code></pre>
  422. * @constructor
  423. * Creates a new Separator
  424. * @xtype tbseparator
  425. */
  426. T.Separator = Ext.extend(T.Item, {
  427. onRender : function(ct, position){
  428. this.el = ct.createChild({tag:'span', cls:'xtb-sep'}, position);
  429. }
  430. });
  431. Ext.reg('tbseparator', T.Separator);
  432. /**
  433. * @class Ext.Toolbar.Spacer
  434. * @extends Ext.Toolbar.Item
  435. * A simple element that adds extra horizontal space between items in a toolbar.
  436. * By default a 2px wide space is added via css specification:<pre><code>
  437. .x-toolbar .xtb-spacer {
  438. width:2px;
  439. }
  440. * </code></pre>
  441. * <p>Example usage:</p>
  442. * <pre><code>
  443. new Ext.Panel({
  444. tbar : [
  445. 'Item 1',
  446. {xtype: 'tbspacer'}, // or ' '
  447. 'Item 2',
  448. // space width is also configurable via javascript
  449. {xtype: 'tbspacer', width: 50}, // add a 50px space
  450. 'Item 3'
  451. ]
  452. });
  453. </code></pre>
  454. * @constructor
  455. * Creates a new Spacer
  456. * @xtype tbspacer
  457. */
  458. T.Spacer = Ext.extend(T.Item, {
  459. /**
  460. * @cfg {Number} width
  461. * The width of the spacer in pixels (defaults to 2px via css style <tt>.x-toolbar .xtb-spacer</tt>).
  462. */
  463. onRender : function(ct, position){
  464. this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position);
  465. }
  466. });
  467. Ext.reg('tbspacer', T.Spacer);
  468. /**
  469. * @class Ext.Toolbar.Fill
  470. * @extends Ext.Toolbar.Spacer
  471. * A non-rendering placeholder item which instructs the Toolbar's Layout to begin using
  472. * the right-justified button container.
  473. * <pre><code>
  474. new Ext.Panel({
  475. tbar : [
  476. 'Item 1',
  477. {xtype: 'tbfill'}, // or '->'
  478. 'Item 2'
  479. ]
  480. });
  481. </code></pre>
  482. * @constructor
  483. * Creates a new Fill
  484. * @xtype tbfill
  485. */
  486. T.Fill = Ext.extend(T.Item, {
  487. // private
  488. render : Ext.emptyFn,
  489. isFill : true
  490. });
  491. Ext.reg('tbfill', T.Fill);
  492. /**
  493. * @class Ext.Toolbar.TextItem
  494. * @extends Ext.Toolbar.Item
  495. * A simple class that renders text directly into a toolbar
  496. * (with css class:<tt>'xtb-text'</tt>). Example usage:
  497. * <pre><code>
  498. new Ext.Panel({
  499. tbar : [
  500. {xtype: 'tbtext', text: 'Item 1'} // or simply 'Item 1'
  501. ]
  502. });
  503. </code></pre>
  504. * @constructor
  505. * Creates a new TextItem
  506. * @param {String/Object} text A text string, or a config object containing a <tt>text</tt> property
  507. * @xtype tbtext
  508. */
  509. T.TextItem = Ext.extend(T.Item, {
  510. /**
  511. * @cfg {String} text The text to be used as innerHTML (html tags are accepted)
  512. */
  513. constructor: function(config){
  514. T.TextItem.superclass.constructor.call(this, Ext.isString(config) ? {text: config} : config);
  515. },
  516. // private
  517. onRender : function(ct, position) {
  518. this.autoEl = {cls: 'xtb-text', html: this.text || ''};
  519. T.TextItem.superclass.onRender.call(this, ct, position);
  520. },
  521. /**
  522. * Updates this item's text, setting the text to be used as innerHTML.
  523. * @param {String} t The text to display (html accepted).
  524. */
  525. setText : function(t) {
  526. if(this.rendered){
  527. this.el.update(t);
  528. }else{
  529. this.text = t;
  530. }
  531. }
  532. });
  533. Ext.reg('tbtext', T.TextItem);
  534. // backwards compat
  535. T.Button = Ext.extend(Ext.Button, {});
  536. T.SplitButton = Ext.extend(Ext.SplitButton, {});
  537. Ext.reg('tbbutton', T.Button);
  538. Ext.reg('tbsplit', T.SplitButton);
  539. })();
  540. /**
  541. * @class Ext.ButtonGroup
  542. * @extends Ext.Panel
  543. * Container for a group of buttons. Example usage:
  544. * <pre><code>
  545. var p = new Ext.Panel({
  546. title: 'Panel with Button Group',
  547. width: 300,
  548. height:200,
  549. renderTo: document.body,
  550. html: 'whatever',
  551. tbar: [{
  552. xtype: 'buttongroup',
  553. {@link #columns}: 3,
  554. title: 'Clipboard',
  555. items: [{
  556. text: 'Paste',
  557. scale: 'large',
  558. rowspan: 3, iconCls: 'add',
  559. iconAlign: 'top',
  560. cls: 'x-btn-as-arrow'
  561. },{
  562. xtype:'splitbutton',
  563. text: 'Menu Button',
  564. scale: 'large',
  565. rowspan: 3,
  566. iconCls: 'add',
  567. iconAlign: 'top',
  568. arrowAlign:'bottom',
  569. menu: [{text: 'Menu Item 1'}]
  570. },{
  571. xtype:'splitbutton', text: 'Cut', iconCls: 'add16', menu: [{text: 'Cut Menu Item'}]
  572. },{
  573. text: 'Copy', iconCls: 'add16'
  574. },{
  575. text: 'Format', iconCls: 'add16'
  576. }]
  577. }]
  578. });
  579. * </code></pre>
  580. * @constructor
  581. * Create a new ButtonGroup.
  582. * @param {Object} config The config object
  583. * @xtype buttongroup
  584. */
  585. Ext.ButtonGroup = Ext.extend(Ext.Panel, {
  586. /**
  587. * @cfg {Number} columns The <tt>columns</tt> configuration property passed to the
  588. * {@link #layout configured layout manager}. See {@link Ext.layout.TableLayout#columns}.
  589. */
  590. /**
  591. * @cfg {String} baseCls Defaults to <tt>'x-btn-group'</tt>. See {@link Ext.Panel#baseCls}.
  592. */
  593. baseCls: 'x-btn-group',
  594. /**
  595. * @cfg {String} layout Defaults to <tt>'table'</tt>. See {@link Ext.Container#layout}.
  596. */
  597. layout:'table',
  598. defaultType: 'button',
  599. /**
  600. * @cfg {Boolean} frame Defaults to <tt>true</tt>. See {@link Ext.Panel#frame}.
  601. */
  602. frame: true,
  603. internalDefaults: {removeMode: 'container', hideParent: true},
  604. initComponent : function(){
  605. this.layoutConfig = this.layoutConfig || {};
  606. Ext.applyIf(this.layoutConfig, {
  607. columns : this.columns
  608. });
  609. if(!this.title){
  610. this.addClass('x-btn-group-notitle');
  611. }
  612. this.on('afterlayout', this.onAfterLayout, this);
  613. Ext.ButtonGroup.superclass.initComponent.call(this);
  614. },
  615. applyDefaults : function(c){
  616. c = Ext.ButtonGroup.superclass.applyDefaults.call(this, c);
  617. var d = this.internalDefaults;
  618. if(c.events){
  619. Ext.applyIf(c.initialConfig, d);
  620. Ext.apply(c, d);
  621. }else{
  622. Ext.applyIf(c, d);
  623. }
  624. return c;
  625. },
  626. onAfterLayout : function(){
  627. var bodyWidth = this.body.getFrameWidth('lr') + this.body.dom.firstChild.offsetWidth;
  628. this.body.setWidth(bodyWidth);
  629. this.el.setWidth(bodyWidth + this.getFrameWidth());
  630. }
  631. /**
  632. * @cfg {Array} tools @hide
  633. */
  634. });
  635. Ext.reg('buttongroup', Ext.ButtonGroup);
  636. /**
  637. * @class Ext.PagingToolbar
  638. * @extends Ext.Toolbar
  639. * <p>As the amount of records increases, the time required for the browser to render
  640. * them increases. Paging is used to reduce the amount of data exchanged with the client.
  641. * Note: if there are more records/rows than can be viewed in the available screen area, vertical
  642. * scrollbars will be added.</p>
  643. * <p>Paging is typically handled on the server side (see exception below). The client sends
  644. * parameters to the server side, which the server needs to interpret and then respond with the
  645. * approprate data.</p>
  646. * <p><b>Ext.PagingToolbar</b> is a specialized toolbar that is bound to a {@link Ext.data.Store}
  647. * and provides automatic paging control. This Component {@link Ext.data.Store#load load}s blocks
  648. * of data into the <tt>{@link #store}</tt> by passing {@link Ext.data.Store#paramNames paramNames} used for
  649. * paging criteria.</p>
  650. * <p>PagingToolbar is typically used as one of the Grid's toolbars:</p>
  651. * <pre><code>
  652. Ext.QuickTips.init(); // to display button quicktips
  653. var myStore = new Ext.data.Store({
  654. reader: new Ext.data.JsonReader({
  655. {@link Ext.data.JsonReader#totalProperty totalProperty}: 'results',
  656. ...
  657. }),
  658. ...
  659. });
  660. var myPageSize = 25; // server script should only send back 25 items at a time
  661. var grid = new Ext.grid.GridPanel({
  662. ...
  663. store: myStore,
  664. bbar: new Ext.PagingToolbar({
  665. {@link #store}: myStore, // grid and PagingToolbar using same store
  666. {@link #displayInfo}: true,
  667. {@link #pageSize}: myPageSize,
  668. {@link #prependButtons}: true,
  669. items: [
  670. 'text 1'
  671. ]
  672. })
  673. });
  674. * </code></pre>
  675. *
  676. * <p>To use paging, pass the paging requirements to the server when the store is first loaded.</p>
  677. * <pre><code>
  678. store.load({
  679. params: {
  680. // specify params for the first page load if using paging
  681. start: 0,
  682. limit: myPageSize,
  683. // other params
  684. foo: 'bar'
  685. }
  686. });
  687. * </code></pre>
  688. *
  689. * <p>If using {@link Ext.data.Store#autoLoad store's autoLoad} configuration:</p>
  690. * <pre><code>
  691. var myStore = new Ext.data.Store({
  692. {@link Ext.data.Store#autoLoad autoLoad}: {params:{start: 0, limit: 25}},
  693. ...
  694. });
  695. * </code></pre>
  696. *
  697. * <p>The packet sent back from the server would have this form:</p>
  698. * <pre><code>
  699. {
  700. "success": true,
  701. "results": 2000,
  702. "rows": [ // <b>*Note:</b> this must be an Array
  703. { "id": 1, "name": "Bill", "occupation": "Gardener" },
  704. { "id": 2, "name": "Ben", "occupation": "Horticulturalist" },
  705. ...
  706. { "id": 25, "name": "Sue", "occupation": "Botanist" }
  707. ]
  708. }
  709. * </code></pre>
  710. * <p><u>Paging with Local Data</u></p>
  711. * <p>Paging can also be accomplished with local data using extensions:</p>
  712. * <div class="mdetail-params"><ul>
  713. * <li><a href="http://extjs.com/forum/showthread.php?t=71532">Ext.ux.data.PagingStore</a></li>
  714. * <li>Paging Memory Proxy (examples/ux/PagingMemoryProxy.js)</li>
  715. * </ul></div>
  716. * @constructor Create a new PagingToolbar
  717. * @param {Object} config The config object
  718. * @xtype paging
  719. */
  720. (function() {
  721. var T = Ext.Toolbar;
  722. Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
  723. /**
  724. * @cfg {Ext.data.Store} store
  725. * The {@link Ext.data.Store} the paging toolbar should use as its data source (required).
  726. */
  727. /**
  728. * @cfg {Boolean} displayInfo
  729. * <tt>true</tt> to display the displayMsg (defaults to <tt>false</tt>)
  730. */
  731. /**
  732. * @cfg {Number} pageSize
  733. * The number of records to display per page (defaults to <tt>20</tt>)
  734. */
  735. pageSize : 20,
  736. /**
  737. * @cfg {Boolean} prependButtons
  738. * <tt>true</tt> to insert any configured <tt>items</tt> <i>before</i> the paging buttons.
  739. * Defaults to <tt>false</tt>.
  740. */
  741. /**
  742. * @cfg {String} displayMsg
  743. * The paging status message to display (defaults to <tt>'Displaying {0} - {1} of {2}'</tt>).
  744. * Note that this string is formatted using the braced numbers <tt>{0}-{2}</tt> as tokens
  745. * that are replaced by the values for start, end and total respectively. These tokens should
  746. * be preserved when overriding this string if showing those values is desired.
  747. */
  748. displayMsg : 'Displaying {0} - {1} of {2}',
  749. /**
  750. * @cfg {String} emptyMsg
  751. * The message to display when no records are found (defaults to 'No data to display')
  752. */
  753. emptyMsg : 'No data to display',
  754. /**
  755. * @cfg {String} beforePageText
  756. * The text displayed before the input item (defaults to <tt>'Page'</tt>).
  757. */
  758. beforePageText : 'Page',
  759. /**
  760. * @cfg {String} afterPageText
  761. * Customizable piece of the default paging text (defaults to <tt>'of {0}'</tt>). Note that
  762. * this string is formatted using <tt>{0}</tt> as a token that is replaced by the number of
  763. * total pages. This token should be preserved when overriding this string if showing the
  764. * total page count is desired.
  765. */
  766. afterPageText : 'of {0}',
  767. /**
  768. * @cfg {String} firstText
  769. * The quicktip text displayed for the first page button (defaults to <tt>'First Page'</tt>).
  770. * <b>Note</b>: quick tips must be initialized for the quicktip to show.
  771. */
  772. firstText : 'First Page',
  773. /**
  774. * @cfg {String} prevText
  775. * The quicktip text displayed for the previous page button (defaults to <tt>'Previous Page'</tt>).
  776. * <b>Note</b>: quick tips must be initialized for the quicktip to show.
  777. */
  778. prevText : 'Previous Page',
  779. /**
  780. * @cfg {String} nextText
  781. * The quicktip text displayed for the next page button (defaults to <tt>'Next Page'</tt>).
  782. * <b>Note</b>: quick tips must be initialized for the quicktip to show.
  783. */
  784. nextText : 'Next Page',
  785. /**
  786. * @cfg {String} lastText
  787. * The quicktip text displayed for the last page button (defaults to <tt>'Last Page'</tt>).
  788. * <b>Note</b>: quick tips must be initialized for the quicktip to show.
  789. */
  790. lastText : 'Last Page',
  791. /**
  792. * @cfg {String} refreshText
  793. * The quicktip text displayed for the Refresh button (defaults to <tt>'Refresh'</tt>).
  794. * <b>Note</b>: quick tips must be initialized for the quicktip to show.
  795. */
  796. refreshText : 'Refresh',
  797. /**
  798. * <p><b>Deprecated</b>. <code>paramNames</code> should be set in the <b>data store</b>
  799. * (see {@link Ext.data.Store#paramNames}).</p>
  800. * <br><p>Object mapping of parameter names used for load calls, initially set to:</p>
  801. * <pre>{start: 'start', limit: 'limit'}</pre>
  802. * @type Object
  803. * @property paramNames
  804. * @deprecated
  805. */
  806. /**
  807. * The number of records to display per page. See also <tt>{@link #cursor}</tt>.
  808. * @type Number
  809. * @property pageSize
  810. */
  811. /**
  812. * Indicator for the record position. This property might be used to get the active page
  813. * number for example:<pre><code>
  814. * // t is reference to the paging toolbar instance
  815. * var activePage = Math.ceil((t.cursor + t.pageSize) / t.pageSize);
  816. * </code></pre>
  817. * @type Number
  818. * @property cursor
  819. */
  820. initComponent : function(){
  821. var pagingItems = [this.first = new T.Button({
  822. tooltip: this.firstText,
  823. overflowText: this.firstText,
  824. iconCls: 'x-tbar-page-first',
  825. disabled: true,
  826. handler: this.moveFirst,
  827. scope: this
  828. }), this.prev = new T.Button({
  829. tooltip: this.prevText,
  830. overflowText: this.prevText,
  831. iconCls: 'x-tbar-page-prev',
  832. disabled: true,
  833. handler: this.movePrevious,
  834. scope: this
  835. }), '-', this.beforePageText,
  836. this.inputItem = new Ext.form.NumberField({
  837. cls: 'x-tbar-page-number',
  838. allowDecimals: false,
  839. allowNegative: false,
  840. enableKeyEvents: true,
  841. selectOnFocus: true,
  842. submitValue: false,
  843. listeners: {
  844. scope: this,
  845. keydown: this.onPagingKeyDown,
  846. blur: this.onPagingBlur
  847. }
  848. }), this.afterTextItem = new T.TextItem({
  849. text: String.format(this.afterPageText, 1)
  850. }), '-', this.next = new T.Button({
  851. tooltip: this.nextText,
  852. overflowText: this.nextText,
  853. iconCls: 'x-tbar-page-next',
  854. disabled: true,
  855. handler: this.moveNext,
  856. scope: this
  857. }), this.last = new T.Button({
  858. tooltip: this.lastText,
  859. overflowText: this.lastText,
  860. iconCls: 'x-tbar-page-last',
  861. disabled: true,
  862. handler: this.moveLast,
  863. scope: this
  864. }), '-', this.refresh = new T.Button({
  865. tooltip: this.refreshText,
  866. overflowText: this.refreshText,
  867. iconCls: 'x-tbar-loading',
  868. handler: this.doRefresh,
  869. scope: this
  870. })];
  871. var userItems = this.items || this.buttons || [];
  872. if (this.prependButtons) {
  873. this.items = userItems.concat(pagingItems);
  874. }else{
  875. this.items = pagingItems.concat(userItems);
  876. }
  877. delete this.buttons;
  878. if(this.displayInfo){
  879. this.items.push('->');
  880. this.items.push(this.displayItem = new T.TextItem({}));
  881. }
  882. Ext.PagingToolbar.superclass.initComponent.call(this);
  883. this.addEvents(
  884. /**
  885. * @event change
  886. * Fires after the active page has been changed.
  887. * @param {Ext.PagingToolbar} this
  888. * @param {Object} pageData An object that has these properties:<ul>
  889. * <li><code>total</code> : Number <div class="sub-desc">The total number of records in the dataset as
  890. * returned by the server</div></li>
  891. * <li><code>activePage</code> : Number <div class="sub-desc">The current page number</div></li>
  892. * <li><code>pages</code> : Number <div class="sub-desc">The total number of pages (calculated from
  893. * the total number of records in the dataset as returned by the server and the current {@link #pageSize})</div></li>
  894. * </ul>
  895. */
  896. 'change',
  897. /**
  898. * @event beforechange
  899. * Fires just before the active page is changed.
  900. * Return false to prevent the active page from being changed.
  901. * @param {Ext.PagingToolbar} this
  902. * @param {Object} params An object hash of the parameters which the PagingToolbar will send when
  903. * loading the required page. This will contain:<ul>
  904. * <li><code>start</code> : Number <div class="sub-desc">The starting row number for the next page of records to
  905. * be retrieved from the server</div></li>
  906. * <li><code>limit</code> : Number <div class="sub-desc">The number of records to be retrieved from the server</div></li>
  907. * </ul>
  908. * <p>(note: the names of the <b>start</b> and <b>limit</b> properties are determined
  909. * by the store's {@link Ext.data.Store#paramNames paramNames} property.)</p>
  910. * <p>Parameters may be added as required in the event handler.</p>
  911. */
  912. 'beforechange'
  913. );
  914. this.on('afterlayout', this.onFirstLayout, this, {single: true});
  915. this.cursor = 0;
  916. this.bindStore(this.store, true);
  917. },
  918. // private
  919. onFirstLayout : function(){
  920. if(this.dsLoaded){
  921. this.onLoad.apply(this, this.dsLoaded);
  922. }
  923. },
  924. // private
  925. updateInfo : function(){
  926. if(this.displayItem){
  927. var count = this.store.getCount();
  928. var msg = count == 0 ?
  929. this.emptyMsg :
  930. String.format(
  931. this.displayMsg,
  932. this.cursor+1, this.cursor+count, this.store.getTotalCount()
  933. );
  934. this.displayItem.setText(msg);
  935. }
  936. },
  937. // private
  938. onLoad : function(store, r, o){
  939. if(!this.rendered){
  940. this.dsLoaded = [store, r, o];
  941. return;
  942. }
  943. var p = this.getParams();
  944. this.cursor = (o.params && o.params[p.start]) ? o.params[p.start] : 0;
  945. var d = this.getPageData(), ap = d.activePage, ps = d.pages;
  946. this.afterTextItem.setText(String.format(this.afterPageText, d.pages));
  947. this.inputItem.setValue(ap);
  948. this.first.setDisabled(ap == 1);
  949. this.prev.setDisabled(ap == 1);
  950. this.next.setDisabled(ap == ps);
  951. this.last.setDisabled(ap == ps);
  952. this.refresh.enable();
  953. this.updateInfo();
  954. this.fireEvent('change', this, d);
  955. },
  956. // private
  957. getPageData : function(){
  958. var total = this.store.getTotalCount();
  959. return {
  960. total : total,
  961. activePage : Math.ceil((this.cursor+this.pageSize)/this.pageSize),
  962. pages : total < this.pageSize ? 1 : Math.ceil(total/this.pageSize)
  963. };
  964. },
  965. /**
  966. * Change the active page
  967. * @param {Integer} page The page to display
  968. */
  969. changePage : function(page){
  970. this.doLoad(((page-1) * this.pageSize).constrain(0, this.store.getTotalCount()));
  971. },
  972. // private
  973. onLoadError : function(){
  974. if(!this.rendered){
  975. return;
  976. }
  977. this.refresh.enable();
  978. },
  979. // private
  980. readPage : function(d){
  981. var v = this.inputItem.getValue(), pageNum;
  982. if (!v || isNaN(pageNum = parseInt(v, 10))) {
  983. this.inputItem.setValue(d.activePage);
  984. return false;
  985. }
  986. return pageNum;
  987. },
  988. onPagingFocus : function(){
  989. this.inputItem.select();
  990. },
  991. //private
  992. onPagingBlur : function(e){
  993. this.inputItem.setValue(this.getPageData().activePage);
  994. },
  995. // private
  996. onPagingKeyDown : function(field, e){
  997. var k = e.getKey(), d = this.getPageData(), pageNum;
  998. if (k == e.RETURN) {
  999. e.stopEvent();
  1000. pageNum = this.readPage(d);
  1001. if(pageNum !== false){
  1002. pageNum = Math.min(Math.max(1, pageNum), d.pages) - 1;
  1003. this.doLoad(pageNum * this.pageSize);
  1004. }
  1005. }else if (k == e.HOME || k == e.END){
  1006. e.stopEvent();
  1007. pageNum = k == e.HOME ? 1 : d.pages;
  1008. field.setValue(pageNum);
  1009. }else if (k == e.UP || k == e.PAGEUP || k == e.DOWN || k == e.PAGEDOWN){
  1010. e.stopEvent();
  1011. if((pageNum = this.readPage(d))){
  1012. var increment = e.shiftKey ? 10 : 1;
  1013. if(k == e.DOWN || k == e.PAGEDOWN){
  1014. increment *= -1;
  1015. }
  1016. pageNum += increment;
  1017. if(pageNum >= 1 & pageNum <= d.pages){
  1018. field.setValue(pageNum);
  1019. }
  1020. }
  1021. }
  1022. },
  1023. // private
  1024. getParams : function(){
  1025. //retain backwards compat, allow params on the toolbar itself, if they exist.
  1026. return this.paramNames || this.store.paramNames;
  1027. },
  1028. // private
  1029. beforeLoad : function(){
  1030. if(this.rendered && this.refresh){
  1031. this.refresh.disable();
  1032. }
  1033. },
  1034. // private
  1035. doLoad : function(start){
  1036. var o = {}, pn = this.getParams();
  1037. o[pn.start] = start;
  1038. o[pn.limit] = this.pageSize;
  1039. if(this.fireEvent('beforechange', this, o) !== false){
  1040. this.store.load({params:o});
  1041. }
  1042. },
  1043. /**
  1044. * Move to the first page, has the same effect as clicking the 'first' button.
  1045. */
  1046. moveFirst : function(){
  1047. this.doLoad(0);
  1048. },
  1049. /**
  1050. * Move to the previous page, has the same effect as clicking the 'previous' button.
  1051. */
  1052. movePrevious : function(){
  1053. this.doLoad(Math.max(0, this.cursor-this.pageSize));
  1054. },
  1055. /**
  1056. * Move to the next page, has the same effect as clicking the 'next' button.
  1057. */
  1058. moveNext : function(){
  1059. this.doLoad(this.cursor+this.pageSize);
  1060. },
  1061. /**
  1062. * Move to the last page, has the same effect as clicking the 'last' button.
  1063. */
  1064. moveLast : function(){
  1065. var total = this.store.getTotalCount(),
  1066. extra = total % this.pageSize;
  1067. this.doLoad(extra ? (total - extra) : total - this.pageSize);
  1068. },
  1069. /**
  1070. * Refresh the current page, has the same effect as clicking the 'refresh' button.
  1071. */
  1072. doRefresh : function(){
  1073. this.doLoad(this.cursor);
  1074. },
  1075. /**
  1076. * Binds the paging toolbar to the specified {@link Ext.data.Store}
  1077. * @param {Store} store The store to bind to this toolbar
  1078. * @param {Boolean} initial (Optional) true to not remove listeners
  1079. */
  1080. bindStore : function(store, initial){
  1081. var doLoad;
  1082. if(!initial && this.store){
  1083. if(store !== this.store && this.store.autoDestroy){
  1084. this.store.destroy();
  1085. }else{
  1086. this.store.un('beforeload', this.beforeLoad, this);
  1087. this.store.un('load', this.onLoad, this);
  1088. this.store.un('exception', this.onLoadError, this);
  1089. }
  1090. if(!store){
  1091. this.store = null;
  1092. }
  1093. }
  1094. if(store){
  1095. store = Ext.StoreMgr.lookup(store);
  1096. store.on({
  1097. scope: this,
  1098. beforeload: this.beforeLoad,
  1099. load: this.onLoad,
  1100. exception: this.onLoadError
  1101. });
  1102. doLoad = true;
  1103. }
  1104. this.store = store;
  1105. if(doLoad){
  1106. this.onLoad(store, null, {});
  1107. }
  1108. },
  1109. /**
  1110. * Unbinds the paging toolbar from the specified {@link Ext.data.Store} <b>(deprecated)</b>
  1111. * @param {Ext.data.Store} store The data store to unbind
  1112. */
  1113. unbind : function(store){
  1114. this.bindStore(null);
  1115. },
  1116. /**
  1117. * Binds the paging toolbar to the specified {@link Ext.data.Store} <b>(deprecated)</b>
  1118. * @param {Ext.data.Store} store The data store to bind
  1119. */
  1120. bind : function(store){
  1121. this.bindStore(store);
  1122. },
  1123. // private
  1124. onDestroy : function(){
  1125. this.bindStore(null);
  1126. Ext.PagingToolbar.superclass.onDestroy.call(this);
  1127. }
  1128. });
  1129. })();
  1130. Ext.reg('paging', Ext.PagingToolbar);