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.

1138 lines
45 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-grid-GridPanel-method-constructor'><span id='Ext-grid-GridPanel'>/**
  19. </span></span> * @class Ext.grid.GridPanel
  20. * @extends Ext.Panel
  21. * &lt;p&gt;This class represents the primary interface of a component based grid control to represent data
  22. * in a tabular format of rows and columns. The GridPanel is composed of the following:&lt;/p&gt;
  23. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  24. * &lt;li&gt;&lt;b&gt;{@link Ext.data.Store Store}&lt;/b&gt; : The Model holding the data records (rows)
  25. * &lt;div class=&quot;sub-desc&quot;&gt;&lt;/div&gt;&lt;/li&gt;
  26. * &lt;li&gt;&lt;b&gt;{@link Ext.grid.ColumnModel Column model}&lt;/b&gt; : Column makeup
  27. * &lt;div class=&quot;sub-desc&quot;&gt;&lt;/div&gt;&lt;/li&gt;
  28. * &lt;li&gt;&lt;b&gt;{@link Ext.grid.GridView View}&lt;/b&gt; : Encapsulates the user interface
  29. * &lt;div class=&quot;sub-desc&quot;&gt;&lt;/div&gt;&lt;/li&gt;
  30. * &lt;li&gt;&lt;b&gt;{@link Ext.grid.AbstractSelectionModel selection model}&lt;/b&gt; : Selection behavior
  31. * &lt;div class=&quot;sub-desc&quot;&gt;&lt;/div&gt;&lt;/li&gt;
  32. * &lt;/ul&gt;&lt;/div&gt;
  33. * &lt;p&gt;Example usage:&lt;/p&gt;
  34. * &lt;pre&gt;&lt;code&gt;
  35. var grid = new Ext.grid.GridPanel({
  36. {@link #store}: new {@link Ext.data.Store}({
  37. {@link Ext.data.Store#autoDestroy autoDestroy}: true,
  38. {@link Ext.data.Store#reader reader}: reader,
  39. {@link Ext.data.Store#data data}: xg.dummyData
  40. }),
  41. {@link #colModel}: new {@link Ext.grid.ColumnModel}({
  42. {@link Ext.grid.ColumnModel#defaults defaults}: {
  43. width: 120,
  44. sortable: true
  45. },
  46. {@link Ext.grid.ColumnModel#columns columns}: [
  47. {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},
  48. {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
  49. {header: 'Change', dataIndex: 'change'},
  50. {header: '% Change', dataIndex: 'pctChange'},
  51. // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype
  52. {
  53. header: 'Last Updated', width: 135, dataIndex: 'lastChange',
  54. xtype: 'datecolumn', format: 'M d, Y'
  55. }
  56. ]
  57. }),
  58. {@link #viewConfig}: {
  59. {@link Ext.grid.GridView#forceFit forceFit}: true,
  60. // Return CSS class to apply to rows depending upon data values
  61. {@link Ext.grid.GridView#getRowClass getRowClass}: function(record, index) {
  62. var c = record.{@link Ext.data.Record#get get}('change');
  63. if (c &lt; 0) {
  64. return 'price-fall';
  65. } else if (c &gt; 0) {
  66. return 'price-rise';
  67. }
  68. }
  69. },
  70. {@link #sm}: new Ext.grid.RowSelectionModel({singleSelect:true}),
  71. width: 600,
  72. height: 300,
  73. frame: true,
  74. title: 'Framed with Row Selection and Horizontal Scrolling',
  75. iconCls: 'icon-grid'
  76. });
  77. * &lt;/code&gt;&lt;/pre&gt;
  78. * &lt;p&gt;&lt;b&gt;&lt;u&gt;Notes:&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;
  79. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  80. * &lt;li&gt;Although this class inherits many configuration options from base classes, some of them
  81. * (such as autoScroll, autoWidth, layout, items, etc) are not used by this class, and will
  82. * have no effect.&lt;/li&gt;
  83. * &lt;li&gt;A grid &lt;b&gt;requires&lt;/b&gt; a width in which to scroll its columns, and a height in which to
  84. * scroll its rows. These dimensions can either be set explicitly through the
  85. * &lt;tt&gt;{@link Ext.BoxComponent#height height}&lt;/tt&gt; and &lt;tt&gt;{@link Ext.BoxComponent#width width}&lt;/tt&gt;
  86. * configuration options or implicitly set by using the grid as a child item of a
  87. * {@link Ext.Container Container} which will have a {@link Ext.Container#layout layout manager}
  88. * provide the sizing of its child items (for example the Container of the Grid may specify
  89. * &lt;tt&gt;{@link Ext.Container#layout layout}:'fit'&lt;/tt&gt;).&lt;/li&gt;
  90. * &lt;li&gt;To access the data in a Grid, it is necessary to use the data model encapsulated
  91. * by the {@link #store Store}. See the {@link #cellclick} event for more details.&lt;/li&gt;
  92. * &lt;/ul&gt;&lt;/div&gt;
  93. * @constructor
  94. * @param {Object} config The config object
  95. * @xtype grid
  96. */
  97. Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
  98. <span id='Ext-grid-GridPanel-cfg-autoExpandColumn'> /**
  99. </span> * @cfg {String} autoExpandColumn
  100. * &lt;p&gt;The &lt;tt&gt;{@link Ext.grid.Column#id id}&lt;/tt&gt; of a {@link Ext.grid.Column column} in
  101. * this grid that should expand to fill unused space. This value specified here can not
  102. * be &lt;tt&gt;0&lt;/tt&gt;.&lt;/p&gt;
  103. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: If the Grid's {@link Ext.grid.GridView view} is configured with
  104. * &lt;tt&gt;{@link Ext.grid.GridView#forceFit forceFit}=true&lt;/tt&gt; the &lt;tt&gt;autoExpandColumn&lt;/tt&gt;
  105. * is ignored. See {@link Ext.grid.Column}.&lt;tt&gt;{@link Ext.grid.Column#width width}&lt;/tt&gt;
  106. * for additional details.&lt;/p&gt;
  107. * &lt;p&gt;See &lt;tt&gt;{@link #autoExpandMax}&lt;/tt&gt; and &lt;tt&gt;{@link #autoExpandMin}&lt;/tt&gt; also.&lt;/p&gt;
  108. */
  109. autoExpandColumn : false,
  110. <span id='Ext-grid-GridPanel-cfg-autoExpandMax'> /**
  111. </span> * @cfg {Number} autoExpandMax The maximum width the &lt;tt&gt;{@link #autoExpandColumn}&lt;/tt&gt;
  112. * can have (if enabled). Defaults to &lt;tt&gt;1000&lt;/tt&gt;.
  113. */
  114. autoExpandMax : 1000,
  115. <span id='Ext-grid-GridPanel-cfg-autoExpandMin'> /**
  116. </span> * @cfg {Number} autoExpandMin The minimum width the &lt;tt&gt;{@link #autoExpandColumn}&lt;/tt&gt;
  117. * can have (if enabled). Defaults to &lt;tt&gt;50&lt;/tt&gt;.
  118. */
  119. autoExpandMin : 50,
  120. <span id='Ext-grid-GridPanel-cfg-columnLines'> /**
  121. </span> * @cfg {Boolean} columnLines &lt;tt&gt;true&lt;/tt&gt; to add css for column separation lines.
  122. * Default is &lt;tt&gt;false&lt;/tt&gt;.
  123. */
  124. columnLines : false,
  125. <span id='Ext-grid-GridPanel-cfg-cm'> /**
  126. </span> * @cfg {Object} cm Shorthand for &lt;tt&gt;{@link #colModel}&lt;/tt&gt;.
  127. */
  128. <span id='Ext-grid-GridPanel-cfg-colModel'> /**
  129. </span> * @cfg {Object} colModel The {@link Ext.grid.ColumnModel} to use when rendering the grid (required).
  130. */
  131. <span id='Ext-grid-GridPanel-cfg-columns'> /**
  132. </span> * @cfg {Array} columns An array of {@link Ext.grid.Column columns} to auto create a
  133. * {@link Ext.grid.ColumnModel}. The ColumnModel may be explicitly created via the
  134. * &lt;tt&gt;{@link #colModel}&lt;/tt&gt; configuration property.
  135. */
  136. <span id='Ext-grid-GridPanel-cfg-ddGroup'> /**
  137. </span> * @cfg {String} ddGroup The DD group this GridPanel belongs to. Defaults to &lt;tt&gt;'GridDD'&lt;/tt&gt; if not specified.
  138. */
  139. <span id='Ext-grid-GridPanel-cfg-ddText'> /**
  140. </span> * @cfg {String} ddText
  141. * Configures the text in the drag proxy. Defaults to:
  142. * &lt;pre&gt;&lt;code&gt;
  143. * ddText : '{0} selected row{1}'
  144. * &lt;/code&gt;&lt;/pre&gt;
  145. * &lt;tt&gt;{0}&lt;/tt&gt; is replaced with the number of selected rows.
  146. */
  147. ddText : '{0} selected row{1}',
  148. <span id='Ext-grid-GridPanel-cfg-dragCell'> /**
  149. </span> * @cfg {Boolean} dragCell Defaults to &lt;code&gt;false&lt;/code&gt;. If using {@link #enableDragDrop} with a CellSelectionModel,
  150. * set this to true to have the {@link #getView view}'s {@link Ext.grid.GridView#dragZone dragZone}'s &lt;code&gt;getDragData&lt;/code&gt;
  151. * method reference the selected &lt;b&gt;cell&lt;/b&gt; using &lt;code&gt;[rowIndex, cellIndex]&lt;/code&gt;
  152. */
  153. <span id='Ext-grid-GridPanel-cfg-deferRowRender'> /**
  154. </span> * @cfg {Boolean} deferRowRender &lt;P&gt;Defaults to &lt;tt&gt;true&lt;/tt&gt; to enable deferred row rendering.&lt;/p&gt;
  155. * &lt;p&gt;This allows the GridPanel to be initially rendered empty, with the expensive update of the row
  156. * structure deferred so that layouts with GridPanels appear more quickly.&lt;/p&gt;
  157. */
  158. deferRowRender : true,
  159. <span id='Ext-grid-GridPanel-cfg-disableSelection'> /**
  160. </span> * @cfg {Boolean} disableSelection &lt;p&gt;&lt;tt&gt;true&lt;/tt&gt; to disable selections in the grid. Defaults to &lt;tt&gt;false&lt;/tt&gt;.&lt;/p&gt;
  161. * &lt;p&gt;Ignored if a {@link #selModel SelectionModel} is specified.&lt;/p&gt;
  162. */
  163. <span id='Ext-grid-GridPanel-cfg-enableColumnResize'> /**
  164. </span> * @cfg {Boolean} enableColumnResize &lt;tt&gt;false&lt;/tt&gt; to turn off column resizing for the whole grid. Defaults to &lt;tt&gt;true&lt;/tt&gt;.
  165. */
  166. <span id='Ext-grid-GridPanel-cfg-enableColumnHide'> /**
  167. </span> * @cfg {Boolean} enableColumnHide
  168. * Defaults to &lt;tt&gt;true&lt;/tt&gt; to enable {@link Ext.grid.Column#hidden hiding of columns}
  169. * with the {@link #enableHdMenu header menu}.
  170. */
  171. enableColumnHide : true,
  172. <span id='Ext-grid-GridPanel-cfg-enableColumnMove'> /**
  173. </span> * @cfg {Boolean} enableColumnMove Defaults to &lt;tt&gt;true&lt;/tt&gt; to enable drag and drop reorder of columns. &lt;tt&gt;false&lt;/tt&gt;
  174. * to turn off column reordering via drag drop.
  175. */
  176. enableColumnMove : true,
  177. <span id='Ext-grid-GridPanel-cfg-enableDragDrop'> /**
  178. </span> * @cfg {Boolean} enableDragDrop &lt;p&gt;Enables dragging of the selected rows of the GridPanel. Defaults to &lt;tt&gt;false&lt;/tt&gt;.&lt;/p&gt;
  179. * &lt;p&gt;Setting this to &lt;b&gt;&lt;tt&gt;true&lt;/tt&gt;&lt;/b&gt; causes this GridPanel's {@link #getView GridView} to
  180. * create an instance of {@link Ext.grid.GridDragZone}. &lt;b&gt;Note&lt;/b&gt;: this is available only &lt;b&gt;after&lt;/b&gt;
  181. * the Grid has been rendered as the GridView's &lt;tt&gt;{@link Ext.grid.GridView#dragZone dragZone}&lt;/tt&gt;
  182. * property.&lt;/p&gt;
  183. * &lt;p&gt;A cooperating {@link Ext.dd.DropZone DropZone} must be created who's implementations of
  184. * {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver},
  185. * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop} are able
  186. * to process the {@link Ext.grid.GridDragZone#getDragData data} which is provided.&lt;/p&gt;
  187. */
  188. enableDragDrop : false,
  189. <span id='Ext-grid-GridPanel-cfg-enableHdMenu'> /**
  190. </span> * @cfg {Boolean} enableHdMenu Defaults to &lt;tt&gt;true&lt;/tt&gt; to enable the drop down button for menu in the headers.
  191. */
  192. enableHdMenu : true,
  193. <span id='Ext-grid-GridPanel-cfg-hideHeaders'> /**
  194. </span> * @cfg {Boolean} hideHeaders True to hide the grid's header. Defaults to &lt;code&gt;false&lt;/code&gt;.
  195. */
  196. <span id='Ext-grid-GridPanel-cfg-loadMask'> /**
  197. </span> * @cfg {Object} loadMask An {@link Ext.LoadMask} config or true to mask the grid while
  198. * loading. Defaults to &lt;code&gt;false&lt;/code&gt;.
  199. */
  200. loadMask : false,
  201. <span id='Ext-grid-GridPanel-cfg-maxHeight'> /**
  202. </span> * @cfg {Number} maxHeight Sets the maximum height of the grid - ignored if &lt;tt&gt;autoHeight&lt;/tt&gt; is not on.
  203. */
  204. <span id='Ext-grid-GridPanel-cfg-minColumnWidth'> /**
  205. </span> * @cfg {Number} minColumnWidth The minimum width a column can be resized to. Defaults to &lt;tt&gt;25&lt;/tt&gt;.
  206. */
  207. minColumnWidth : 25,
  208. <span id='Ext-grid-GridPanel-cfg-sm'> /**
  209. </span> * @cfg {Object} sm Shorthand for &lt;tt&gt;{@link #selModel}&lt;/tt&gt;.
  210. */
  211. <span id='Ext-grid-GridPanel-cfg-selModel'> /**
  212. </span> * @cfg {Object} selModel Any subclass of {@link Ext.grid.AbstractSelectionModel} that will provide
  213. * the selection model for the grid (defaults to {@link Ext.grid.RowSelectionModel} if not specified).
  214. */
  215. <span id='Ext-grid-GridPanel-cfg-store'> /**
  216. </span> * @cfg {Ext.data.Store} store The {@link Ext.data.Store} the grid should use as its data source (required).
  217. */
  218. <span id='Ext-grid-GridPanel-cfg-stripeRows'> /**
  219. </span> * @cfg {Boolean} stripeRows &lt;tt&gt;true&lt;/tt&gt; to stripe the rows. Default is &lt;tt&gt;false&lt;/tt&gt;.
  220. * &lt;p&gt;This causes the CSS class &lt;tt&gt;&lt;b&gt;x-grid3-row-alt&lt;/b&gt;&lt;/tt&gt; to be added to alternate rows of
  221. * the grid. A default CSS rule is provided which sets a background colour, but you can override this
  222. * with a rule which either overrides the &lt;b&gt;background-color&lt;/b&gt; style using the '!important'
  223. * modifier, or which uses a CSS selector of higher specificity.&lt;/p&gt;
  224. */
  225. stripeRows : false,
  226. <span id='Ext-grid-GridPanel-cfg-trackMouseOver'> /**
  227. </span> * @cfg {Boolean} trackMouseOver True to highlight rows when the mouse is over. Default is &lt;tt&gt;true&lt;/tt&gt;
  228. * for GridPanel, but &lt;tt&gt;false&lt;/tt&gt; for EditorGridPanel.
  229. */
  230. trackMouseOver : true,
  231. <span id='Ext-grid-GridPanel-cfg-stateEvents'> /**
  232. </span> * @cfg {Array} stateEvents
  233. * An array of events that, when fired, should trigger this component to save its state.
  234. * Defaults to:&lt;pre&gt;&lt;code&gt;
  235. * stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange']
  236. * &lt;/code&gt;&lt;/pre&gt;
  237. * &lt;p&gt;These can be any types of events supported by this component, including browser or
  238. * custom events (e.g., &lt;tt&gt;['click', 'customerchange']&lt;/tt&gt;).&lt;/p&gt;
  239. * &lt;p&gt;See {@link Ext.Component#stateful} for an explanation of saving and restoring
  240. * Component state.&lt;/p&gt;
  241. */
  242. stateEvents : ['columnmove', 'columnresize', 'sortchange', 'groupchange'],
  243. <span id='Ext-grid-GridPanel-cfg-view'> /**
  244. </span> * @cfg {Object} view The {@link Ext.grid.GridView} used by the grid. This can be set
  245. * before a call to {@link Ext.Component#render render()}.
  246. */
  247. view : null,
  248. <span id='Ext-grid-GridPanel-cfg-bubbleEvents'> /**
  249. </span> * @cfg {Array} bubbleEvents
  250. * &lt;p&gt;An array of events that, when fired, should be bubbled to any parent container.
  251. * See {@link Ext.util.Observable#enableBubble}.
  252. * Defaults to &lt;tt&gt;[]&lt;/tt&gt;.
  253. */
  254. bubbleEvents: [],
  255. <span id='Ext-grid-GridPanel-cfg-viewConfig'> /**
  256. </span> * @cfg {Object} viewConfig A config object that will be applied to the grid's UI view. Any of
  257. * the config options available for {@link Ext.grid.GridView} can be specified here. This option
  258. * is ignored if &lt;tt&gt;{@link #view}&lt;/tt&gt; is specified.
  259. */
  260. <span id='Ext-grid-GridPanel-property-rendered'> // private
  261. </span> rendered : false,
  262. <span id='Ext-grid-GridPanel-property-viewReady'> // private
  263. </span> viewReady : false,
  264. <span id='Ext-grid-GridPanel-method-initComponent'> // private
  265. </span> initComponent : function() {
  266. Ext.grid.GridPanel.superclass.initComponent.call(this);
  267. if (this.columnLines) {
  268. this.cls = (this.cls || '') + ' x-grid-with-col-lines';
  269. }
  270. // override any provided value since it isn't valid
  271. // and is causing too many bug reports ;)
  272. this.autoScroll = false;
  273. this.autoWidth = false;
  274. if(Ext.isArray(this.columns)){
  275. this.colModel = new Ext.grid.ColumnModel(this.columns);
  276. delete this.columns;
  277. }
  278. // check and correct shorthanded configs
  279. if(this.ds){
  280. this.store = this.ds;
  281. delete this.ds;
  282. }
  283. if(this.cm){
  284. this.colModel = this.cm;
  285. delete this.cm;
  286. }
  287. if(this.sm){
  288. this.selModel = this.sm;
  289. delete this.sm;
  290. }
  291. this.store = Ext.StoreMgr.lookup(this.store);
  292. this.addEvents(
  293. // raw events
  294. <span id='Ext-grid-GridPanel-event-click'> /**
  295. </span> * @event click
  296. * The raw click event for the entire grid.
  297. * @param {Ext.EventObject} e
  298. */
  299. 'click',
  300. <span id='Ext-grid-GridPanel-event-dblclick'> /**
  301. </span> * @event dblclick
  302. * The raw dblclick event for the entire grid.
  303. * @param {Ext.EventObject} e
  304. */
  305. 'dblclick',
  306. <span id='Ext-grid-GridPanel-event-contextmenu'> /**
  307. </span> * @event contextmenu
  308. * The raw contextmenu event for the entire grid.
  309. * @param {Ext.EventObject} e
  310. */
  311. 'contextmenu',
  312. <span id='Ext-grid-GridPanel-event-mousedown'> /**
  313. </span> * @event mousedown
  314. * The raw mousedown event for the entire grid.
  315. * @param {Ext.EventObject} e
  316. */
  317. 'mousedown',
  318. <span id='Ext-grid-GridPanel-event-mouseup'> /**
  319. </span> * @event mouseup
  320. * The raw mouseup event for the entire grid.
  321. * @param {Ext.EventObject} e
  322. */
  323. 'mouseup',
  324. <span id='Ext-grid-GridPanel-event-mouseover'> /**
  325. </span> * @event mouseover
  326. * The raw mouseover event for the entire grid.
  327. * @param {Ext.EventObject} e
  328. */
  329. 'mouseover',
  330. <span id='Ext-grid-GridPanel-event-mouseout'> /**
  331. </span> * @event mouseout
  332. * The raw mouseout event for the entire grid.
  333. * @param {Ext.EventObject} e
  334. */
  335. 'mouseout',
  336. <span id='Ext-grid-GridPanel-event-keypress'> /**
  337. </span> * @event keypress
  338. * The raw keypress event for the entire grid.
  339. * @param {Ext.EventObject} e
  340. */
  341. 'keypress',
  342. <span id='Ext-grid-GridPanel-event-keydown'> /**
  343. </span> * @event keydown
  344. * The raw keydown event for the entire grid.
  345. * @param {Ext.EventObject} e
  346. */
  347. 'keydown',
  348. // custom events
  349. <span id='Ext-grid-GridPanel-event-cellmousedown'> /**
  350. </span> * @event cellmousedown
  351. * Fires before a cell is clicked
  352. * @param {Grid} this
  353. * @param {Number} rowIndex
  354. * @param {Number} columnIndex
  355. * @param {Ext.EventObject} e
  356. */
  357. 'cellmousedown',
  358. <span id='Ext-grid-GridPanel-event-rowmousedown'> /**
  359. </span> * @event rowmousedown
  360. * Fires before a row is clicked
  361. * @param {Grid} this
  362. * @param {Number} rowIndex
  363. * @param {Ext.EventObject} e
  364. */
  365. 'rowmousedown',
  366. <span id='Ext-grid-GridPanel-event-headermousedown'> /**
  367. </span> * @event headermousedown
  368. * Fires before a header is clicked
  369. * @param {Grid} this
  370. * @param {Number} columnIndex
  371. * @param {Ext.EventObject} e
  372. */
  373. 'headermousedown',
  374. <span id='Ext-grid-GridPanel-event-groupmousedown'> /**
  375. </span> * @event groupmousedown
  376. * Fires before a group header is clicked. &lt;b&gt;Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}&lt;/b&gt;.
  377. * @param {Grid} this
  378. * @param {String} groupField
  379. * @param {String} groupValue
  380. * @param {Ext.EventObject} e
  381. */
  382. 'groupmousedown',
  383. <span id='Ext-grid-GridPanel-event-rowbodymousedown'> /**
  384. </span> * @event rowbodymousedown
  385. * Fires before the row body is clicked. &lt;b&gt;Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.&lt;/b&gt;
  386. * @param {Grid} this
  387. * @param {Number} rowIndex
  388. * @param {Ext.EventObject} e
  389. */
  390. 'rowbodymousedown',
  391. <span id='Ext-grid-GridPanel-event-containermousedown'> /**
  392. </span> * @event containermousedown
  393. * Fires before the container is clicked. The container consists of any part of the grid body that is not covered by a row.
  394. * @param {Grid} this
  395. * @param {Ext.EventObject} e
  396. */
  397. 'containermousedown',
  398. <span id='Ext-grid-GridPanel-event-cellclick'> /**
  399. </span> * @event cellclick
  400. * Fires when a cell is clicked.
  401. * The data for the cell is drawn from the {@link Ext.data.Record Record}
  402. * for this row. To access the data in the listener function use the
  403. * following technique:
  404. * &lt;pre&gt;&lt;code&gt;
  405. function(grid, rowIndex, columnIndex, e) {
  406. var record = grid.getStore().getAt(rowIndex); // Get the Record
  407. var fieldName = grid.getColumnModel().getDataIndex(columnIndex); // Get field name
  408. var data = record.get(fieldName);
  409. }
  410. &lt;/code&gt;&lt;/pre&gt;
  411. * @param {Grid} this
  412. * @param {Number} rowIndex
  413. * @param {Number} columnIndex
  414. * @param {Ext.EventObject} e
  415. */
  416. 'cellclick',
  417. <span id='Ext-grid-GridPanel-event-celldblclick'> /**
  418. </span> * @event celldblclick
  419. * Fires when a cell is double clicked
  420. * @param {Grid} this
  421. * @param {Number} rowIndex
  422. * @param {Number} columnIndex
  423. * @param {Ext.EventObject} e
  424. */
  425. 'celldblclick',
  426. <span id='Ext-grid-GridPanel-event-rowclick'> /**
  427. </span> * @event rowclick
  428. * Fires when a row is clicked
  429. * @param {Grid} this
  430. * @param {Number} rowIndex
  431. * @param {Ext.EventObject} e
  432. */
  433. 'rowclick',
  434. <span id='Ext-grid-GridPanel-event-rowdblclick'> /**
  435. </span> * @event rowdblclick
  436. * Fires when a row is double clicked
  437. * @param {Grid} this
  438. * @param {Number} rowIndex
  439. * @param {Ext.EventObject} e
  440. */
  441. 'rowdblclick',
  442. <span id='Ext-grid-GridPanel-event-headerclick'> /**
  443. </span> * @event headerclick
  444. * Fires when a header is clicked
  445. * @param {Grid} this
  446. * @param {Number} columnIndex
  447. * @param {Ext.EventObject} e
  448. */
  449. 'headerclick',
  450. <span id='Ext-grid-GridPanel-event-headerdblclick'> /**
  451. </span> * @event headerdblclick
  452. * Fires when a header cell is double clicked
  453. * @param {Grid} this
  454. * @param {Number} columnIndex
  455. * @param {Ext.EventObject} e
  456. */
  457. 'headerdblclick',
  458. <span id='Ext-grid-GridPanel-event-groupclick'> /**
  459. </span> * @event groupclick
  460. * Fires when group header is clicked. &lt;b&gt;Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}&lt;/b&gt;.
  461. * @param {Grid} this
  462. * @param {String} groupField
  463. * @param {String} groupValue
  464. * @param {Ext.EventObject} e
  465. */
  466. 'groupclick',
  467. <span id='Ext-grid-GridPanel-event-groupdblclick'> /**
  468. </span> * @event groupdblclick
  469. * Fires when group header is double clicked. &lt;b&gt;Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}&lt;/b&gt;.
  470. * @param {Grid} this
  471. * @param {String} groupField
  472. * @param {String} groupValue
  473. * @param {Ext.EventObject} e
  474. */
  475. 'groupdblclick',
  476. <span id='Ext-grid-GridPanel-event-containerclick'> /**
  477. </span> * @event containerclick
  478. * Fires when the container is clicked. The container consists of any part of the grid body that is not covered by a row.
  479. * @param {Grid} this
  480. * @param {Ext.EventObject} e
  481. */
  482. 'containerclick',
  483. <span id='Ext-grid-GridPanel-event-containerdblclick'> /**
  484. </span> * @event containerdblclick
  485. * Fires when the container is double clicked. The container consists of any part of the grid body that is not covered by a row.
  486. * @param {Grid} this
  487. * @param {Ext.EventObject} e
  488. */
  489. 'containerdblclick',
  490. <span id='Ext-grid-GridPanel-event-rowbodyclick'> /**
  491. </span> * @event rowbodyclick
  492. * Fires when the row body is clicked. &lt;b&gt;Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.&lt;/b&gt;
  493. * @param {Grid} this
  494. * @param {Number} rowIndex
  495. * @param {Ext.EventObject} e
  496. */
  497. 'rowbodyclick',
  498. <span id='Ext-grid-GridPanel-event-rowbodydblclick'> /**
  499. </span> * @event rowbodydblclick
  500. * Fires when the row body is double clicked. &lt;b&gt;Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.&lt;/b&gt;
  501. * @param {Grid} this
  502. * @param {Number} rowIndex
  503. * @param {Ext.EventObject} e
  504. */
  505. 'rowbodydblclick',
  506. <span id='Ext-grid-GridPanel-event-rowcontextmenu'> /**
  507. </span> * @event rowcontextmenu
  508. * Fires when a row is right clicked
  509. * @param {Grid} this
  510. * @param {Number} rowIndex
  511. * @param {Ext.EventObject} e
  512. */
  513. 'rowcontextmenu',
  514. <span id='Ext-grid-GridPanel-event-cellcontextmenu'> /**
  515. </span> * @event cellcontextmenu
  516. * Fires when a cell is right clicked
  517. * @param {Grid} this
  518. * @param {Number} rowIndex
  519. * @param {Number} cellIndex
  520. * @param {Ext.EventObject} e
  521. */
  522. 'cellcontextmenu',
  523. <span id='Ext-grid-GridPanel-event-headercontextmenu'> /**
  524. </span> * @event headercontextmenu
  525. * Fires when a header is right clicked
  526. * @param {Grid} this
  527. * @param {Number} columnIndex
  528. * @param {Ext.EventObject} e
  529. */
  530. 'headercontextmenu',
  531. <span id='Ext-grid-GridPanel-event-groupcontextmenu'> /**
  532. </span> * @event groupcontextmenu
  533. * Fires when group header is right clicked. &lt;b&gt;Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}&lt;/b&gt;.
  534. * @param {Grid} this
  535. * @param {String} groupField
  536. * @param {String} groupValue
  537. * @param {Ext.EventObject} e
  538. */
  539. 'groupcontextmenu',
  540. <span id='Ext-grid-GridPanel-event-containercontextmenu'> /**
  541. </span> * @event containercontextmenu
  542. * Fires when the container is right clicked. The container consists of any part of the grid body that is not covered by a row.
  543. * @param {Grid} this
  544. * @param {Ext.EventObject} e
  545. */
  546. 'containercontextmenu',
  547. <span id='Ext-grid-GridPanel-event-rowbodycontextmenu'> /**
  548. </span> * @event rowbodycontextmenu
  549. * Fires when the row body is right clicked. &lt;b&gt;Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.&lt;/b&gt;
  550. * @param {Grid} this
  551. * @param {Number} rowIndex
  552. * @param {Ext.EventObject} e
  553. */
  554. 'rowbodycontextmenu',
  555. <span id='Ext-grid-GridPanel-event-bodyscroll'> /**
  556. </span> * @event bodyscroll
  557. * Fires when the body element is scrolled
  558. * @param {Number} scrollLeft
  559. * @param {Number} scrollTop
  560. */
  561. 'bodyscroll',
  562. <span id='Ext-grid-GridPanel-event-columnresize'> /**
  563. </span> * @event columnresize
  564. * Fires when the user resizes a column
  565. * @param {Number} columnIndex
  566. * @param {Number} newSize
  567. */
  568. 'columnresize',
  569. <span id='Ext-grid-GridPanel-event-columnmove'> /**
  570. </span> * @event columnmove
  571. * Fires when the user moves a column
  572. * @param {Number} oldIndex
  573. * @param {Number} newIndex
  574. */
  575. 'columnmove',
  576. <span id='Ext-grid-GridPanel-event-sortchange'> /**
  577. </span> * @event sortchange
  578. * Fires when the grid's store sort changes
  579. * @param {Grid} this
  580. * @param {Object} sortInfo An object with the keys field and direction
  581. */
  582. 'sortchange',
  583. <span id='Ext-grid-GridPanel-event-groupchange'> /**
  584. </span> * @event groupchange
  585. * Fires when the grid's grouping changes (only applies for grids with a {@link Ext.grid.GroupingView GroupingView})
  586. * @param {Grid} this
  587. * @param {String} groupField A string with the grouping field, null if the store is not grouped.
  588. */
  589. 'groupchange',
  590. <span id='Ext-grid-GridPanel-event-reconfigure'> /**
  591. </span> * @event reconfigure
  592. * Fires when the grid is reconfigured with a new store and/or column model.
  593. * @param {Grid} this
  594. * @param {Ext.data.Store} store The new store
  595. * @param {Ext.grid.ColumnModel} colModel The new column model
  596. */
  597. 'reconfigure',
  598. <span id='Ext-grid-GridPanel-event-viewready'> /**
  599. </span> * @event viewready
  600. * Fires when the grid view is available (use this for selecting a default row).
  601. * @param {Grid} this
  602. */
  603. 'viewready'
  604. );
  605. },
  606. <span id='Ext-grid-GridPanel-method-onRender'> // private
  607. </span> onRender : function(ct, position){
  608. Ext.grid.GridPanel.superclass.onRender.apply(this, arguments);
  609. var c = this.getGridEl();
  610. this.el.addClass('x-grid-panel');
  611. this.mon(c, {
  612. scope: this,
  613. mousedown: this.onMouseDown,
  614. click: this.onClick,
  615. dblclick: this.onDblClick,
  616. contextmenu: this.onContextMenu
  617. });
  618. this.relayEvents(c, ['mousedown','mouseup','mouseover','mouseout','keypress', 'keydown']);
  619. var view = this.getView();
  620. view.init(this);
  621. view.render();
  622. this.getSelectionModel().init(this);
  623. },
  624. <span id='Ext-grid-GridPanel-method-initEvents'> // private
  625. </span> initEvents : function(){
  626. Ext.grid.GridPanel.superclass.initEvents.call(this);
  627. if(this.loadMask){
  628. this.loadMask = new Ext.LoadMask(this.bwrap,
  629. Ext.apply({store:this.store}, this.loadMask));
  630. }
  631. },
  632. <span id='Ext-grid-GridPanel-method-initStateEvents'> initStateEvents : function(){
  633. </span> Ext.grid.GridPanel.superclass.initStateEvents.call(this);
  634. this.mon(this.colModel, 'hiddenchange', this.saveState, this, {delay: 100});
  635. },
  636. <span id='Ext-grid-GridPanel-method-applyState'> applyState : function(state){
  637. </span> var cm = this.colModel,
  638. cs = state.columns,
  639. store = this.store,
  640. s,
  641. c,
  642. colIndex;
  643. if(cs){
  644. for(var i = 0, len = cs.length; i &lt; len; i++){
  645. s = cs[i];
  646. c = cm.getColumnById(s.id);
  647. if(c){
  648. colIndex = cm.getIndexById(s.id);
  649. cm.setState(colIndex, {
  650. hidden: s.hidden,
  651. width: s.width,
  652. sortable: c.sortable,
  653. editable: c.editable
  654. });
  655. if(colIndex != i){
  656. cm.moveColumn(colIndex, i);
  657. }
  658. }
  659. }
  660. }
  661. if(store){
  662. s = state.sort;
  663. if(s){
  664. store[store.remoteSort ? 'setDefaultSort' : 'sort'](s.field, s.direction);
  665. }
  666. s = state.group;
  667. if(store.groupBy){
  668. if(s){
  669. store.groupBy(s);
  670. }else{
  671. store.clearGrouping();
  672. }
  673. }
  674. }
  675. var o = Ext.apply({}, state);
  676. delete o.columns;
  677. delete o.sort;
  678. Ext.grid.GridPanel.superclass.applyState.call(this, o);
  679. },
  680. <span id='Ext-grid-GridPanel-method-getState'> getState : function(){
  681. </span> var o = {columns: []},
  682. store = this.store,
  683. ss,
  684. gs;
  685. for(var i = 0, c; (c = this.colModel.config[i]); i++){
  686. o.columns[i] = {
  687. id: c.id,
  688. width: c.width
  689. };
  690. if(c.hidden){
  691. o.columns[i].hidden = true;
  692. }
  693. }
  694. if(store){
  695. ss = store.getSortState();
  696. if(ss){
  697. o.sort = ss;
  698. }
  699. if(store.getGroupState){
  700. gs = store.getGroupState();
  701. if(gs){
  702. o.group = gs;
  703. }
  704. }
  705. }
  706. return o;
  707. },
  708. <span id='Ext-grid-GridPanel-method-afterRender'> // private
  709. </span> afterRender : function(){
  710. Ext.grid.GridPanel.superclass.afterRender.call(this);
  711. var v = this.view;
  712. this.on('bodyresize', v.layout, v);
  713. v.layout(true);
  714. if(this.deferRowRender){
  715. if (!this.deferRowRenderTask){
  716. this.deferRowRenderTask = new Ext.util.DelayedTask(v.afterRender, this.view);
  717. }
  718. this.deferRowRenderTask.delay(10);
  719. }else{
  720. v.afterRender();
  721. }
  722. this.viewReady = true;
  723. },
  724. <span id='Ext-grid-GridPanel-method-reconfigure'> /**
  725. </span> * &lt;p&gt;Reconfigures the grid to use a different Store and Column Model
  726. * and fires the 'reconfigure' event. The View will be bound to the new
  727. * objects and refreshed.&lt;/p&gt;
  728. * &lt;p&gt;Be aware that upon reconfiguring a GridPanel, certain existing settings &lt;i&gt;may&lt;/i&gt; become
  729. * invalidated. For example the configured {@link #autoExpandColumn} may no longer exist in the
  730. * new ColumnModel. Also, an existing {@link Ext.PagingToolbar PagingToolbar} will still be bound
  731. * to the old Store, and will need rebinding. Any {@link #plugins} might also need reconfiguring
  732. * with the new data.&lt;/p&gt;
  733. * @param {Ext.data.Store} store The new {@link Ext.data.Store} object
  734. * @param {Ext.grid.ColumnModel} colModel The new {@link Ext.grid.ColumnModel} object
  735. */
  736. reconfigure : function(store, colModel){
  737. var rendered = this.rendered;
  738. if(rendered){
  739. if(this.loadMask){
  740. this.loadMask.destroy();
  741. this.loadMask = new Ext.LoadMask(this.bwrap,
  742. Ext.apply({}, {store:store}, this.initialConfig.loadMask));
  743. }
  744. }
  745. if(this.view){
  746. this.view.initData(store, colModel);
  747. }
  748. this.store = store;
  749. this.colModel = colModel;
  750. if(rendered){
  751. this.view.refresh(true);
  752. }
  753. this.fireEvent('reconfigure', this, store, colModel);
  754. },
  755. <span id='Ext-grid-GridPanel-method-onDestroy'> // private
  756. </span> onDestroy : function(){
  757. if (this.deferRowRenderTask &amp;&amp; this.deferRowRenderTask.cancel){
  758. this.deferRowRenderTask.cancel();
  759. }
  760. if(this.rendered){
  761. Ext.destroy(this.view, this.loadMask);
  762. }else if(this.store &amp;&amp; this.store.autoDestroy){
  763. this.store.destroy();
  764. }
  765. Ext.destroy(this.colModel, this.selModel);
  766. this.store = this.selModel = this.colModel = this.view = this.loadMask = null;
  767. Ext.grid.GridPanel.superclass.onDestroy.call(this);
  768. },
  769. <span id='Ext-grid-GridPanel-method-processEvent'> // private
  770. </span> processEvent : function(name, e){
  771. this.view.processEvent(name, e);
  772. },
  773. <span id='Ext-grid-GridPanel-method-onClick'> // private
  774. </span> onClick : function(e){
  775. this.processEvent('click', e);
  776. },
  777. <span id='Ext-grid-GridPanel-method-onMouseDown'> // private
  778. </span> onMouseDown : function(e){
  779. this.processEvent('mousedown', e);
  780. },
  781. <span id='Ext-grid-GridPanel-method-onContextMenu'> // private
  782. </span> onContextMenu : function(e, t){
  783. this.processEvent('contextmenu', e);
  784. },
  785. <span id='Ext-grid-GridPanel-method-onDblClick'> // private
  786. </span> onDblClick : function(e){
  787. this.processEvent('dblclick', e);
  788. },
  789. <span id='Ext-grid-GridPanel-method-walkCells'> // private
  790. </span> walkCells : function(row, col, step, fn, scope){
  791. var cm = this.colModel,
  792. clen = cm.getColumnCount(),
  793. ds = this.store,
  794. rlen = ds.getCount(),
  795. first = true;
  796. if(step &lt; 0){
  797. if(col &lt; 0){
  798. row--;
  799. first = false;
  800. }
  801. while(row &gt;= 0){
  802. if(!first){
  803. col = clen-1;
  804. }
  805. first = false;
  806. while(col &gt;= 0){
  807. if(fn.call(scope || this, row, col, cm) === true){
  808. return [row, col];
  809. }
  810. col--;
  811. }
  812. row--;
  813. }
  814. } else {
  815. if(col &gt;= clen){
  816. row++;
  817. first = false;
  818. }
  819. while(row &lt; rlen){
  820. if(!first){
  821. col = 0;
  822. }
  823. first = false;
  824. while(col &lt; clen){
  825. if(fn.call(scope || this, row, col, cm) === true){
  826. return [row, col];
  827. }
  828. col++;
  829. }
  830. row++;
  831. }
  832. }
  833. return null;
  834. },
  835. <span id='Ext-grid-GridPanel-method-getGridEl'> /**
  836. </span> * Returns the grid's underlying element.
  837. * @return {Element} The element
  838. */
  839. getGridEl : function(){
  840. return this.body;
  841. },
  842. <span id='Ext-grid-GridPanel-method-stopEditing'> // private for compatibility, overridden by editor grid
  843. </span> stopEditing : Ext.emptyFn,
  844. <span id='Ext-grid-GridPanel-method-getSelectionModel'> /**
  845. </span> * Returns the grid's selection model configured by the &lt;code&gt;{@link #selModel}&lt;/code&gt;
  846. * configuration option. If no selection model was configured, this will create
  847. * and return a {@link Ext.grid.RowSelectionModel RowSelectionModel}.
  848. * @return {SelectionModel}
  849. */
  850. getSelectionModel : function(){
  851. if(!this.selModel){
  852. this.selModel = new Ext.grid.RowSelectionModel(
  853. this.disableSelection ? {selectRow: Ext.emptyFn} : null);
  854. }
  855. return this.selModel;
  856. },
  857. <span id='Ext-grid-GridPanel-method-getStore'> /**
  858. </span> * Returns the grid's data store.
  859. * @return {Ext.data.Store} The store
  860. */
  861. getStore : function(){
  862. return this.store;
  863. },
  864. <span id='Ext-grid-GridPanel-method-getColumnModel'> /**
  865. </span> * Returns the grid's ColumnModel.
  866. * @return {Ext.grid.ColumnModel} The column model
  867. */
  868. getColumnModel : function(){
  869. return this.colModel;
  870. },
  871. <span id='Ext-grid-GridPanel-method-getView'> /**
  872. </span> * Returns the grid's GridView object.
  873. * @return {Ext.grid.GridView} The grid view
  874. */
  875. getView : function() {
  876. if (!this.view) {
  877. this.view = new Ext.grid.GridView(this.viewConfig);
  878. }
  879. return this.view;
  880. },
  881. <span id='Ext-grid-GridPanel-method-getDragDropText'> /**
  882. </span> * Called to get grid's drag proxy text, by default returns this.ddText.
  883. * @return {String} The text
  884. */
  885. getDragDropText : function(){
  886. var count = this.selModel.getCount ? this.selModel.getCount() : 1;
  887. return String.format(this.ddText, count, count == 1 ? '' : 's');
  888. }
  889. <span id='Ext-grid-GridPanel-cfg-activeItem'> /**
  890. </span> * @cfg {String/Number} activeItem
  891. * @hide
  892. */
  893. <span id='Ext-grid-GridPanel-cfg-autoDestroy'> /**
  894. </span> * @cfg {Boolean} autoDestroy
  895. * @hide
  896. */
  897. <span id='Ext-grid-GridPanel-cfg-autoLoad'> /**
  898. </span> * @cfg {Object/String/Function} autoLoad
  899. * @hide
  900. */
  901. <span id='Ext-grid-GridPanel-cfg-autoWidth'> /**
  902. </span> * @cfg {Boolean} autoWidth
  903. * @hide
  904. */
  905. <span id='Ext-grid-GridPanel-cfg-bufferResize'> /**
  906. </span> * @cfg {Boolean/Number} bufferResize
  907. * @hide
  908. */
  909. <span id='Ext-grid-GridPanel-cfg-defaultType'> /**
  910. </span> * @cfg {String} defaultType
  911. * @hide
  912. */
  913. <span id='Ext-grid-GridPanel-cfg-defaults'> /**
  914. </span> * @cfg {Object} defaults
  915. * @hide
  916. */
  917. <span id='Ext-grid-GridPanel-cfg-hideBorders'> /**
  918. </span> * @cfg {Boolean} hideBorders
  919. * @hide
  920. */
  921. <span id='Ext-grid-GridPanel-cfg-items'> /**
  922. </span> * @cfg {Mixed} items
  923. * @hide
  924. */
  925. <span id='Ext-grid-GridPanel-cfg-layout'> /**
  926. </span> * @cfg {String} layout
  927. * @hide
  928. */
  929. <span id='Ext-grid-GridPanel-cfg-layoutConfig'> /**
  930. </span> * @cfg {Object} layoutConfig
  931. * @hide
  932. */
  933. <span id='Ext-grid-GridPanel-cfg-monitorResize'> /**
  934. </span> * @cfg {Boolean} monitorResize
  935. * @hide
  936. */
  937. <span id='Ext-grid-GridPanel-property-items'> /**
  938. </span> * @property items
  939. * @hide
  940. */
  941. <span id='Ext-grid-GridPanel-method-add'> /**
  942. </span> * @method add
  943. * @hide
  944. */
  945. <span id='Ext-grid-GridPanel-method-cascade'> /**
  946. </span> * @method cascade
  947. * @hide
  948. */
  949. <span id='Ext-grid-GridPanel-method-doLayout'> /**
  950. </span> * @method doLayout
  951. * @hide
  952. */
  953. <span id='Ext-grid-GridPanel-method-find'> /**
  954. </span> * @method find
  955. * @hide
  956. */
  957. <span id='Ext-grid-GridPanel-method-findBy'> /**
  958. </span> * @method findBy
  959. * @hide
  960. */
  961. <span id='Ext-grid-GridPanel-method-findById'> /**
  962. </span> * @method findById
  963. * @hide
  964. */
  965. <span id='Ext-grid-GridPanel-method-findByType'> /**
  966. </span> * @method findByType
  967. * @hide
  968. */
  969. <span id='Ext-grid-GridPanel-method-getComponent'> /**
  970. </span> * @method getComponent
  971. * @hide
  972. */
  973. <span id='Ext-grid-GridPanel-method-getLayout'> /**
  974. </span> * @method getLayout
  975. * @hide
  976. */
  977. <span id='Ext-grid-GridPanel-method-getUpdater'> /**
  978. </span> * @method getUpdater
  979. * @hide
  980. */
  981. <span id='Ext-grid-GridPanel-method-insert'> /**
  982. </span> * @method insert
  983. * @hide
  984. */
  985. <span id='Ext-grid-GridPanel-method-load'> /**
  986. </span> * @method load
  987. * @hide
  988. */
  989. <span id='Ext-grid-GridPanel-method-remove'> /**
  990. </span> * @method remove
  991. * @hide
  992. */
  993. <span id='Ext-grid-GridPanel-event-add'> /**
  994. </span> * @event add
  995. * @hide
  996. */
  997. <span id='Ext-grid-GridPanel-event-afterlayout'> /**
  998. </span> * @event afterlayout
  999. * @hide
  1000. */
  1001. <span id='Ext-grid-GridPanel-event-beforeadd'> /**
  1002. </span> * @event beforeadd
  1003. * @hide
  1004. */
  1005. <span id='Ext-grid-GridPanel-event-beforeremove'> /**
  1006. </span> * @event beforeremove
  1007. * @hide
  1008. */
  1009. <span id='Ext-grid-GridPanel-event-remove'> /**
  1010. </span> * @event remove
  1011. * @hide
  1012. */
  1013. <span id='Ext-grid-GridPanel-cfg-allowDomMove'> /**
  1014. </span> * @cfg {String} allowDomMove @hide
  1015. */
  1016. <span id='Ext-grid-GridPanel-cfg-autoEl'> /**
  1017. </span> * @cfg {String} autoEl @hide
  1018. */
  1019. <span id='Ext-grid-GridPanel-cfg-applyTo'> /**
  1020. </span> * @cfg {String} applyTo @hide
  1021. */
  1022. <span id='Ext-grid-GridPanel-cfg-autoScroll'> /**
  1023. </span> * @cfg {String} autoScroll @hide
  1024. */
  1025. <span id='Ext-grid-GridPanel-cfg-bodyBorder'> /**
  1026. </span> * @cfg {String} bodyBorder @hide
  1027. */
  1028. <span id='Ext-grid-GridPanel-cfg-bodyStyle'> /**
  1029. </span> * @cfg {String} bodyStyle @hide
  1030. */
  1031. <span id='Ext-grid-GridPanel-cfg-contentEl'> /**
  1032. </span> * @cfg {String} contentEl @hide
  1033. */
  1034. <span id='Ext-grid-GridPanel-cfg-disabledClass'> /**
  1035. </span> * @cfg {String} disabledClass @hide
  1036. */
  1037. <span id='Ext-grid-GridPanel-cfg-elements'> /**
  1038. </span> * @cfg {String} elements @hide
  1039. */
  1040. <span id='Ext-grid-GridPanel-cfg-html'> /**
  1041. </span> * @cfg {String} html @hide
  1042. */
  1043. <span id='Ext-grid-GridPanel-cfg-preventBodyReset'> /**
  1044. </span> * @cfg {Boolean} preventBodyReset
  1045. * @hide
  1046. */
  1047. <span id='Ext-grid-GridPanel-property-disabled'> /**
  1048. </span> * @property disabled
  1049. * @hide
  1050. */
  1051. <span id='Ext-grid-GridPanel-method-applyToMarkup'> /**
  1052. </span> * @method applyToMarkup
  1053. * @hide
  1054. */
  1055. <span id='Ext-grid-GridPanel-method-enable'> /**
  1056. </span> * @method enable
  1057. * @hide
  1058. */
  1059. <span id='Ext-grid-GridPanel-method-disable'> /**
  1060. </span> * @method disable
  1061. * @hide
  1062. */
  1063. <span id='Ext-grid-GridPanel-method-setDisabled'> /**
  1064. </span> * @method setDisabled
  1065. * @hide
  1066. */
  1067. });
  1068. Ext.reg('grid', Ext.grid.GridPanel);</pre>
  1069. </body>
  1070. </html>