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.

687 lines
38 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-Column'>/**
  19. </span> * @class Ext.grid.Column
  20. * &lt;p&gt;This class encapsulates column configuration data to be used in the initialization of a
  21. * {@link Ext.grid.ColumnModel ColumnModel}.&lt;/p&gt;
  22. * &lt;p&gt;While subclasses are provided to render data in different ways, this class renders a passed
  23. * data field unchanged and is usually used for textual columns.&lt;/p&gt;
  24. */
  25. Ext.grid.Column = Ext.extend(Ext.util.Observable, {
  26. <span id='Ext-grid-Column-cfg-editable'> /**
  27. </span> * @cfg {Boolean} editable Optional. Defaults to &lt;tt&gt;true&lt;/tt&gt;, enabling the configured
  28. * &lt;tt&gt;{@link #editor}&lt;/tt&gt;. Set to &lt;tt&gt;false&lt;/tt&gt; to initially disable editing on this column.
  29. * The initial configuration may be dynamically altered using
  30. * {@link Ext.grid.ColumnModel}.{@link Ext.grid.ColumnModel#setEditable setEditable()}.
  31. */
  32. <span id='Ext-grid-Column-cfg-id'> /**
  33. </span> * @cfg {String} id Optional. A name which identifies this column (defaults to the column's initial
  34. * ordinal position.) The &lt;tt&gt;id&lt;/tt&gt; is used to create a CSS &lt;b&gt;class&lt;/b&gt; name which is applied to all
  35. * table cells (including headers) in that column (in this context the &lt;tt&gt;id&lt;/tt&gt; does not need to be
  36. * unique). The class name takes the form of &lt;pre&gt;x-grid3-td-&lt;b&gt;id&lt;/b&gt;&lt;/pre&gt;
  37. * Header cells will also receive this class name, but will also have the class &lt;pre&gt;x-grid3-hd&lt;/pre&gt;
  38. * So, to target header cells, use CSS selectors such as:&lt;pre&gt;.x-grid3-hd-row .x-grid3-td-&lt;b&gt;id&lt;/b&gt;&lt;/pre&gt;
  39. * The {@link Ext.grid.GridPanel#autoExpandColumn} grid config option references the column via this
  40. * unique identifier.
  41. */
  42. <span id='Ext-grid-Column-cfg-header'> /**
  43. </span> * @cfg {String} header Optional. The header text to be used as innerHTML
  44. * (html tags are accepted) to display in the Grid view. &lt;b&gt;Note&lt;/b&gt;: to
  45. * have a clickable header with no text displayed use &lt;tt&gt;'&amp;amp;#160;'&lt;/tt&gt;.
  46. */
  47. <span id='Ext-grid-Column-cfg-groupable'> /**
  48. </span> * @cfg {Boolean} groupable Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option
  49. * may be used to disable the header menu item to group by the column selected. Defaults to &lt;tt&gt;true&lt;/tt&gt;,
  50. * which enables the header menu group option. Set to &lt;tt&gt;false&lt;/tt&gt; to disable (but still show) the
  51. * group option in the header menu for the column. See also &lt;code&gt;{@link #groupName}&lt;/code&gt;.
  52. */
  53. <span id='Ext-grid-Column-cfg-groupName'> /**
  54. </span> * @cfg {String} groupName Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option
  55. * may be used to specify the text with which to prefix the group field value in the group header line.
  56. * See also {@link #groupRenderer} and
  57. * {@link Ext.grid.GroupingView}.{@link Ext.grid.GroupingView#showGroupName showGroupName}.
  58. */
  59. <span id='Ext-grid-Column-cfg-groupRenderer'> /**
  60. </span> * @cfg {Function} groupRenderer &lt;p&gt;Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option
  61. * may be used to specify the function used to format the grouping field value for display in the group
  62. * {@link #groupName header}. If a &lt;tt&gt;&lt;b&gt;groupRenderer&lt;/b&gt;&lt;/tt&gt; is not specified, the configured
  63. * &lt;tt&gt;&lt;b&gt;{@link #renderer}&lt;/b&gt;&lt;/tt&gt; will be called; if a &lt;tt&gt;&lt;b&gt;{@link #renderer}&lt;/b&gt;&lt;/tt&gt; is also not specified
  64. * the new value of the group field will be used.&lt;/p&gt;
  65. * &lt;p&gt;The called function (either the &lt;tt&gt;&lt;b&gt;groupRenderer&lt;/b&gt;&lt;/tt&gt; or &lt;tt&gt;&lt;b&gt;{@link #renderer}&lt;/b&gt;&lt;/tt&gt;) will be
  66. * passed the following parameters:
  67. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  68. * &lt;li&gt;&lt;b&gt;v&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;The new value of the group field.&lt;/p&gt;&lt;/li&gt;
  69. * &lt;li&gt;&lt;b&gt;unused&lt;/b&gt; : undefined&lt;p class=&quot;sub-desc&quot;&gt;Unused parameter.&lt;/p&gt;&lt;/li&gt;
  70. * &lt;li&gt;&lt;b&gt;r&lt;/b&gt; : Ext.data.Record&lt;p class=&quot;sub-desc&quot;&gt;The Record providing the data
  71. * for the row which caused group change.&lt;/p&gt;&lt;/li&gt;
  72. * &lt;li&gt;&lt;b&gt;rowIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;The row index of the Record which caused group change.&lt;/p&gt;&lt;/li&gt;
  73. * &lt;li&gt;&lt;b&gt;colIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;The column index of the group field.&lt;/p&gt;&lt;/li&gt;
  74. * &lt;li&gt;&lt;b&gt;ds&lt;/b&gt; : Ext.data.Store&lt;p class=&quot;sub-desc&quot;&gt;The Store which is providing the data Model.&lt;/p&gt;&lt;/li&gt;
  75. * &lt;/ul&gt;&lt;/div&gt;&lt;/p&gt;
  76. * &lt;p&gt;The function should return a string value.&lt;/p&gt;
  77. */
  78. <span id='Ext-grid-Column-cfg-emptyGroupText'> /**
  79. </span> * @cfg {String} emptyGroupText Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option
  80. * may be used to specify the text to display when there is an empty group value. Defaults to the
  81. * {@link Ext.grid.GroupingView}.{@link Ext.grid.GroupingView#emptyGroupText emptyGroupText}.
  82. */
  83. <span id='Ext-grid-Column-cfg-dataIndex'> /**
  84. </span> * @cfg {String} dataIndex &lt;p&gt;&lt;b&gt;Required&lt;/b&gt;. The name of the field in the
  85. * grid's {@link Ext.data.Store}'s {@link Ext.data.Record} definition from
  86. * which to draw the column's value.&lt;/p&gt;
  87. */
  88. <span id='Ext-grid-Column-cfg-width'> /**
  89. </span> * @cfg {Number} width
  90. * Optional. The initial width in pixels of the column.
  91. * The width of each column can also be affected if any of the following are configured:
  92. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  93. * &lt;li&gt;{@link Ext.grid.GridPanel}.&lt;tt&gt;{@link Ext.grid.GridPanel#autoExpandColumn autoExpandColumn}&lt;/tt&gt;&lt;/li&gt;
  94. * &lt;li&gt;{@link Ext.grid.GridView}.&lt;tt&gt;{@link Ext.grid.GridView#forceFit forceFit}&lt;/tt&gt;
  95. * &lt;div class=&quot;sub-desc&quot;&gt;
  96. * &lt;p&gt;By specifying &lt;tt&gt;forceFit:true&lt;/tt&gt;, {@link #fixed non-fixed width} columns will be
  97. * re-proportioned (based on the relative initial widths) to fill the width of the grid so
  98. * that no horizontal scrollbar is shown.&lt;/p&gt;
  99. * &lt;/div&gt;&lt;/li&gt;
  100. * &lt;li&gt;{@link Ext.grid.GridView}.&lt;tt&gt;{@link Ext.grid.GridView#autoFill autoFill}&lt;/tt&gt;&lt;/li&gt;
  101. * &lt;li&gt;{@link Ext.grid.GridPanel}.&lt;tt&gt;{@link Ext.grid.GridPanel#minColumnWidth minColumnWidth}&lt;/tt&gt;&lt;/li&gt;
  102. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: when the width of each column is determined, a space on the right side
  103. * is reserved for the vertical scrollbar. The
  104. * {@link Ext.grid.GridView}.&lt;tt&gt;{@link Ext.grid.GridView#scrollOffset scrollOffset}&lt;/tt&gt;
  105. * can be modified to reduce or eliminate the reserved offset.&lt;/p&gt;
  106. */
  107. <span id='Ext-grid-Column-cfg-sortable'> /**
  108. </span> * @cfg {Boolean} sortable Optional. &lt;tt&gt;true&lt;/tt&gt; if sorting is to be allowed on this column.
  109. * Defaults to the value of the &lt;code&gt;{@link Ext.grid.ColumnModel#defaultSortable}&lt;/code&gt; property.
  110. * Whether local/remote sorting is used is specified in &lt;code&gt;{@link Ext.data.Store#remoteSort}&lt;/code&gt;.
  111. */
  112. <span id='Ext-grid-Column-cfg-fixed'> /**
  113. </span> * @cfg {Boolean} fixed Optional. &lt;tt&gt;true&lt;/tt&gt; if the column width cannot be changed. Defaults to &lt;tt&gt;false&lt;/tt&gt;.
  114. */
  115. <span id='Ext-grid-Column-cfg-resizable'> /**
  116. </span> * @cfg {Boolean} resizable Optional. &lt;tt&gt;false&lt;/tt&gt; to disable column resizing. Defaults to &lt;tt&gt;true&lt;/tt&gt;.
  117. */
  118. <span id='Ext-grid-Column-cfg-menuDisabled'> /**
  119. </span> * @cfg {Boolean} menuDisabled Optional. &lt;tt&gt;true&lt;/tt&gt; to disable the column menu. Defaults to &lt;tt&gt;false&lt;/tt&gt;.
  120. */
  121. <span id='Ext-grid-Column-cfg-hidden'> /**
  122. </span> * @cfg {Boolean} hidden
  123. * Optional. &lt;tt&gt;true&lt;/tt&gt; to initially hide this column. Defaults to &lt;tt&gt;false&lt;/tt&gt;.
  124. * A hidden column {@link Ext.grid.GridPanel#enableColumnHide may be shown via the header row menu}.
  125. * If a column is never to be shown, simply do not include this column in the Column Model at all.
  126. */
  127. <span id='Ext-grid-Column-cfg-tooltip'> /**
  128. </span> * @cfg {String} tooltip Optional. A text string to use as the column header's tooltip. If Quicktips
  129. * are enabled, this value will be used as the text of the quick tip, otherwise it will be set as the
  130. * header's HTML title attribute. Defaults to ''.
  131. */
  132. <span id='Ext-grid-Column-cfg-renderer'> /**
  133. </span> * @cfg {Mixed} renderer
  134. * &lt;p&gt;For an alternative to specifying a renderer see &lt;code&gt;{@link #xtype}&lt;/code&gt;&lt;/p&gt;
  135. * &lt;p&gt;Optional. A renderer is an 'interceptor' method which can be used transform data (value,
  136. * appearance, etc.) before it is rendered). This may be specified in either of three ways:
  137. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  138. * &lt;li&gt;A renderer function used to return HTML markup for a cell given the cell's data value.&lt;/li&gt;
  139. * &lt;li&gt;A string which references a property name of the {@link Ext.util.Format} class which
  140. * provides a renderer function.&lt;/li&gt;
  141. * &lt;li&gt;An object specifying both the renderer function, and its execution scope (&lt;tt&gt;&lt;b&gt;this&lt;/b&gt;&lt;/tt&gt;
  142. * reference) e.g.:&lt;pre style=&quot;margin-left:1.2em&quot;&gt;&lt;code&gt;
  143. {
  144. fn: this.gridRenderer,
  145. scope: this
  146. }
  147. &lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;
  148. * If not specified, the default renderer uses the raw data value.&lt;/p&gt;
  149. * &lt;p&gt;For information about the renderer function (passed parameters, etc.), see
  150. * {@link Ext.grid.ColumnModel#setRenderer}. An example of specifying renderer function inline:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  151. var companyColumn = {
  152. header: 'Company Name',
  153. dataIndex: 'company',
  154. renderer: function(value, metaData, record, rowIndex, colIndex, store) {
  155. // provide the logic depending on business rules
  156. // name of your own choosing to manipulate the cell depending upon
  157. // the data in the underlying Record object.
  158. if (value == 'whatever') {
  159. //metaData.css : String : A CSS class name to add to the TD element of the cell.
  160. //metaData.attr : String : An html attribute definition string to apply to
  161. // the data container element within the table
  162. // cell (e.g. 'style=&quot;color:red;&quot;').
  163. metaData.css = 'name-of-css-class-you-will-define';
  164. }
  165. return value;
  166. }
  167. }
  168. * &lt;/code&gt;&lt;/pre&gt;
  169. * See also {@link #scope}.
  170. */
  171. <span id='Ext-grid-Column-cfg-xtype'> /**
  172. </span> * @cfg {String} xtype Optional. A String which references a predefined {@link Ext.grid.Column} subclass
  173. * type which is preconfigured with an appropriate &lt;code&gt;{@link #renderer}&lt;/code&gt; to be easily
  174. * configured into a ColumnModel. The predefined {@link Ext.grid.Column} subclass types are:
  175. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  176. * &lt;li&gt;&lt;b&gt;&lt;tt&gt;gridcolumn&lt;/tt&gt;&lt;/b&gt; : {@link Ext.grid.Column} (&lt;b&gt;Default&lt;/b&gt;)&lt;p class=&quot;sub-desc&quot;&gt;&lt;/p&gt;&lt;/li&gt;
  177. * &lt;li&gt;&lt;b&gt;&lt;tt&gt;booleancolumn&lt;/tt&gt;&lt;/b&gt; : {@link Ext.grid.BooleanColumn}&lt;p class=&quot;sub-desc&quot;&gt;&lt;/p&gt;&lt;/li&gt;
  178. * &lt;li&gt;&lt;b&gt;&lt;tt&gt;numbercolumn&lt;/tt&gt;&lt;/b&gt; : {@link Ext.grid.NumberColumn}&lt;p class=&quot;sub-desc&quot;&gt;&lt;/p&gt;&lt;/li&gt;
  179. * &lt;li&gt;&lt;b&gt;&lt;tt&gt;datecolumn&lt;/tt&gt;&lt;/b&gt; : {@link Ext.grid.DateColumn}&lt;p class=&quot;sub-desc&quot;&gt;&lt;/p&gt;&lt;/li&gt;
  180. * &lt;li&gt;&lt;b&gt;&lt;tt&gt;templatecolumn&lt;/tt&gt;&lt;/b&gt; : {@link Ext.grid.TemplateColumn}&lt;p class=&quot;sub-desc&quot;&gt;&lt;/p&gt;&lt;/li&gt;
  181. * &lt;/ul&gt;&lt;/div&gt;
  182. * &lt;p&gt;Configuration properties for the specified &lt;code&gt;xtype&lt;/code&gt; may be specified with
  183. * the Column configuration properties, for example:&lt;/p&gt;
  184. * &lt;pre&gt;&lt;code&gt;
  185. var grid = new Ext.grid.GridPanel({
  186. ...
  187. columns: [{
  188. header: 'Last Updated',
  189. dataIndex: 'lastChange',
  190. width: 85,
  191. sortable: true,
  192. //renderer: Ext.util.Format.dateRenderer('m/d/Y'),
  193. xtype: 'datecolumn', // use xtype instead of renderer
  194. format: 'M/d/Y' // configuration property for {@link Ext.grid.DateColumn}
  195. }, {
  196. ...
  197. }]
  198. });
  199. * &lt;/code&gt;&lt;/pre&gt;
  200. */
  201. <span id='Ext-grid-Column-cfg-scope'> /**
  202. </span> * @cfg {Object} scope Optional. The scope (&lt;tt&gt;&lt;b&gt;this&lt;/b&gt;&lt;/tt&gt; reference) in which to execute the
  203. * renderer. Defaults to the Column configuration object.
  204. */
  205. <span id='Ext-grid-Column-cfg-align'> /**
  206. </span> * @cfg {String} align Optional. Set the CSS text-align property of the column. Defaults to undefined.
  207. */
  208. <span id='Ext-grid-Column-cfg-css'> /**
  209. </span> * @cfg {String} css Optional. An inline style definition string which is applied to all table cells in the column
  210. * (excluding headers). Defaults to undefined.
  211. */
  212. <span id='Ext-grid-Column-cfg-hideable'> /**
  213. </span> * @cfg {Boolean} hideable Optional. Specify as &lt;tt&gt;false&lt;/tt&gt; to prevent the user from hiding this column
  214. * (defaults to true). To disallow column hiding globally for all columns in the grid, use
  215. * {@link Ext.grid.GridPanel#enableColumnHide} instead.
  216. */
  217. <span id='Ext-grid-Column-cfg-editor'> /**
  218. </span> * @cfg {Ext.form.Field} editor Optional. The {@link Ext.form.Field} to use when editing values in this column
  219. * if editing is supported by the grid. See &lt;tt&gt;{@link #editable}&lt;/tt&gt; also.
  220. */
  221. <span id='Ext-grid-Column-cfg-isColumn'> /**
  222. </span> * @private
  223. * @cfg {Boolean} isColumn
  224. * Used by ColumnModel setConfig method to avoid reprocessing a Column
  225. * if &lt;code&gt;isColumn&lt;/code&gt; is not set ColumnModel will recreate a new Ext.grid.Column
  226. * Defaults to true.
  227. */
  228. isColumn : true,
  229. <span id='Ext-grid-Column-method-constructor'> constructor : function(config){
  230. </span> Ext.apply(this, config);
  231. if(Ext.isString(this.renderer)){
  232. this.renderer = Ext.util.Format[this.renderer];
  233. }else if(Ext.isObject(this.renderer)){
  234. this.scope = this.renderer.scope;
  235. this.renderer = this.renderer.fn;
  236. }
  237. if(!this.scope){
  238. this.scope = this;
  239. }
  240. var ed = this.editor;
  241. delete this.editor;
  242. this.setEditor(ed);
  243. this.addEvents(
  244. <span id='Ext-grid-Column-event-click'> /**
  245. </span> * @event click
  246. * Fires when this Column is clicked.
  247. * @param {Column} this
  248. * @param {Grid} The owning GridPanel
  249. * @param {Number} rowIndex
  250. * @param {Ext.EventObject} e
  251. */
  252. 'click',
  253. <span id='Ext-grid-Column-event-contextmenu'> /**
  254. </span> * @event contextmenu
  255. * Fires when this Column is right clicked.
  256. * @param {Column} this
  257. * @param {Grid} The owning GridPanel
  258. * @param {Number} rowIndex
  259. * @param {Ext.EventObject} e
  260. */
  261. 'contextmenu',
  262. <span id='Ext-grid-Column-event-dblclick'> /**
  263. </span> * @event dblclick
  264. * Fires when this Column is double clicked.
  265. * @param {Column} this
  266. * @param {Grid} The owning GridPanel
  267. * @param {Number} rowIndex
  268. * @param {Ext.EventObject} e
  269. */
  270. 'dblclick',
  271. <span id='Ext-grid-Column-event-mousedown'> /**
  272. </span> * @event mousedown
  273. * Fires when this Column receives a mousedown event.
  274. * @param {Column} this
  275. * @param {Grid} The owning GridPanel
  276. * @param {Number} rowIndex
  277. * @param {Ext.EventObject} e
  278. */
  279. 'mousedown'
  280. );
  281. Ext.grid.Column.superclass.constructor.call(this);
  282. },
  283. <span id='Ext-grid-Column-method-processEvent'> /**
  284. </span> * @private
  285. * Process and refire events routed from the GridView's processEvent method.
  286. * Returns the event handler's status to allow cancelling of GridView's bubbling process.
  287. */
  288. processEvent : function(name, e, grid, rowIndex, colIndex){
  289. return this.fireEvent(name, this, grid, rowIndex, e);
  290. },
  291. <span id='Ext-grid-Column-method-destroy'> /**
  292. </span> * @private
  293. * Clean up. Remove any Editor. Remove any listeners.
  294. */
  295. destroy: function() {
  296. if(this.setEditor){
  297. this.setEditor(null);
  298. }
  299. this.purgeListeners();
  300. },
  301. <span id='Ext-grid-Column-property-renderer'> /**
  302. </span> * Optional. A function which returns displayable data when passed the following parameters:
  303. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  304. * &lt;li&gt;&lt;b&gt;value&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;The data value for the cell.&lt;/p&gt;&lt;/li&gt;
  305. * &lt;li&gt;&lt;b&gt;metadata&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;An object in which you may set the following attributes:&lt;ul&gt;
  306. * &lt;li&gt;&lt;b&gt;css&lt;/b&gt; : String&lt;p class=&quot;sub-desc&quot;&gt;A CSS class name to add to the cell's TD element.&lt;/p&gt;&lt;/li&gt;
  307. * &lt;li&gt;&lt;b&gt;attr&lt;/b&gt; : String&lt;p class=&quot;sub-desc&quot;&gt;An HTML attribute definition string to apply to the data container
  308. * element &lt;i&gt;within&lt;/i&gt; the table cell (e.g. 'style=&quot;color:red;&quot;').&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;/li&gt;
  309. * &lt;li&gt;&lt;b&gt;record&lt;/b&gt; : Ext.data.record&lt;p class=&quot;sub-desc&quot;&gt;The {@link Ext.data.Record} from which the data was
  310. * extracted.&lt;/p&gt;&lt;/li&gt;
  311. * &lt;li&gt;&lt;b&gt;rowIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;Row index&lt;/p&gt;&lt;/li&gt;
  312. * &lt;li&gt;&lt;b&gt;colIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;Column index&lt;/p&gt;&lt;/li&gt;
  313. * &lt;li&gt;&lt;b&gt;store&lt;/b&gt; : Ext.data.Store&lt;p class=&quot;sub-desc&quot;&gt;The {@link Ext.data.Store} object from which the Record
  314. * was extracted.&lt;/p&gt;&lt;/li&gt;
  315. * &lt;/ul&gt;&lt;/div&gt;
  316. * @property renderer
  317. * @type Function
  318. */
  319. renderer : function(value){
  320. return value;
  321. },
  322. <span id='Ext-grid-Column-method-getEditor'> // private
  323. </span> getEditor: function(rowIndex){
  324. return this.editable !== false ? this.editor : null;
  325. },
  326. <span id='Ext-grid-Column-method-setEditor'> /**
  327. </span> * Sets a new editor for this column.
  328. * @param {Ext.Editor/Ext.form.Field} editor The editor to set
  329. */
  330. setEditor : function(editor){
  331. var ed = this.editor;
  332. if(ed){
  333. if(ed.gridEditor){
  334. ed.gridEditor.destroy();
  335. delete ed.gridEditor;
  336. }else{
  337. ed.destroy();
  338. }
  339. }
  340. this.editor = null;
  341. if(editor){
  342. //not an instance, create it
  343. if(!editor.isXType){
  344. editor = Ext.create(editor, 'textfield');
  345. }
  346. this.editor = editor;
  347. }
  348. },
  349. <span id='Ext-grid-Column-method-getCellEditor'> /**
  350. </span> * Returns the {@link Ext.Editor editor} defined for this column that was created to wrap the {@link Ext.form.Field Field}
  351. * used to edit the cell.
  352. * @param {Number} rowIndex The row index
  353. * @return {Ext.Editor}
  354. */
  355. getCellEditor: function(rowIndex){
  356. var ed = this.getEditor(rowIndex);
  357. if(ed){
  358. if(!ed.startEdit){
  359. if(!ed.gridEditor){
  360. ed.gridEditor = new Ext.grid.GridEditor(ed);
  361. }
  362. ed = ed.gridEditor;
  363. }
  364. }
  365. return ed;
  366. }
  367. });
  368. <span id='Ext-grid-BooleanColumn'>/**
  369. </span> * @class Ext.grid.BooleanColumn
  370. * @extends Ext.grid.Column
  371. * &lt;p&gt;A Column definition class which renders boolean data fields. See the {@link Ext.grid.Column#xtype xtype}
  372. * config option of {@link Ext.grid.Column} for more details.&lt;/p&gt;
  373. */
  374. Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {
  375. <span id='Ext-grid-BooleanColumn-cfg-trueText'> /**
  376. </span> * @cfg {String} trueText
  377. * The string returned by the renderer when the column value is not falsy (defaults to &lt;tt&gt;'true'&lt;/tt&gt;).
  378. */
  379. trueText: 'true',
  380. <span id='Ext-grid-BooleanColumn-cfg-falseText'> /**
  381. </span> * @cfg {String} falseText
  382. * The string returned by the renderer when the column value is falsy (but not undefined) (defaults to
  383. * &lt;tt&gt;'false'&lt;/tt&gt;).
  384. */
  385. falseText: 'false',
  386. <span id='Ext-grid-BooleanColumn-cfg-undefinedText'> /**
  387. </span> * @cfg {String} undefinedText
  388. * The string returned by the renderer when the column value is undefined (defaults to &lt;tt&gt;'&amp;amp;#160;'&lt;/tt&gt;).
  389. */
  390. undefinedText: '&amp;#160;',
  391. <span id='Ext-grid-BooleanColumn-method-constructor'> constructor: function(cfg){
  392. </span> Ext.grid.BooleanColumn.superclass.constructor.call(this, cfg);
  393. var t = this.trueText, f = this.falseText, u = this.undefinedText;
  394. this.renderer = function(v){
  395. if(v === undefined){
  396. return u;
  397. }
  398. if(!v || v === 'false'){
  399. return f;
  400. }
  401. return t;
  402. };
  403. }
  404. });
  405. <span id='Ext-grid-NumberColumn'>/**
  406. </span> * @class Ext.grid.NumberColumn
  407. * @extends Ext.grid.Column
  408. * &lt;p&gt;A Column definition class which renders a numeric data field according to a {@link #format} string. See the
  409. * {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more details.&lt;/p&gt;
  410. */
  411. Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, {
  412. <span id='Ext-grid-NumberColumn-cfg-format'> /**
  413. </span> * @cfg {String} format
  414. * A formatting string as used by {@link Ext.util.Format#number} to format a numeric value for this Column
  415. * (defaults to &lt;tt&gt;'0,000.00'&lt;/tt&gt;).
  416. */
  417. format : '0,000.00',
  418. <span id='Ext-grid-NumberColumn-method-constructor'> constructor: function(cfg){
  419. </span> Ext.grid.NumberColumn.superclass.constructor.call(this, cfg);
  420. this.renderer = Ext.util.Format.numberRenderer(this.format);
  421. }
  422. });
  423. <span id='Ext-grid-DateColumn'>/**
  424. </span> * @class Ext.grid.DateColumn
  425. * @extends Ext.grid.Column
  426. * &lt;p&gt;A Column definition class which renders a passed date according to the default locale, or a configured
  427. * {@link #format}. See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column}
  428. * for more details.&lt;/p&gt;
  429. */
  430. Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {
  431. <span id='Ext-grid-DateColumn-cfg-format'> /**
  432. </span> * @cfg {String} format
  433. * A formatting string as used by {@link Date#format} to format a Date for this Column
  434. * (defaults to &lt;tt&gt;'m/d/Y'&lt;/tt&gt;).
  435. */
  436. format : 'm/d/Y',
  437. <span id='Ext-grid-DateColumn-method-constructor'> constructor: function(cfg){
  438. </span> Ext.grid.DateColumn.superclass.constructor.call(this, cfg);
  439. this.renderer = Ext.util.Format.dateRenderer(this.format);
  440. }
  441. });
  442. <span id='Ext-grid-TemplateColumn'>/**
  443. </span> * @class Ext.grid.TemplateColumn
  444. * @extends Ext.grid.Column
  445. * &lt;p&gt;A Column definition class which renders a value by processing a {@link Ext.data.Record Record}'s
  446. * {@link Ext.data.Record#data data} using a {@link #tpl configured} {@link Ext.XTemplate XTemplate}.
  447. * See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more
  448. * details.&lt;/p&gt;
  449. */
  450. Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, {
  451. <span id='Ext-grid-TemplateColumn-cfg-tpl'> /**
  452. </span> * @cfg {String/XTemplate} tpl
  453. * An {@link Ext.XTemplate XTemplate}, or an XTemplate &lt;i&gt;definition string&lt;/i&gt; to use to process a
  454. * {@link Ext.data.Record Record}'s {@link Ext.data.Record#data data} to produce a column's rendered value.
  455. */
  456. constructor: function(cfg){
  457. Ext.grid.TemplateColumn.superclass.constructor.call(this, cfg);
  458. var tpl = (!Ext.isPrimitive(this.tpl) &amp;&amp; this.tpl.compile) ? this.tpl : new Ext.XTemplate(this.tpl);
  459. this.renderer = function(value, p, r){
  460. return tpl.apply(r.data);
  461. };
  462. this.tpl = tpl;
  463. }
  464. });
  465. <span id='Ext-grid-ActionColumn'>/**
  466. </span> * @class Ext.grid.ActionColumn
  467. * @extends Ext.grid.Column
  468. * &lt;p&gt;A Grid column type which renders an icon, or a series of icons in a grid cell, and offers a scoped click
  469. * handler for each icon. Example usage:&lt;/p&gt;
  470. &lt;pre&gt;&lt;code&gt;
  471. new Ext.grid.GridPanel({
  472. store: myStore,
  473. columns: [
  474. {
  475. xtype: 'actioncolumn',
  476. width: 50,
  477. items: [
  478. {
  479. icon : 'sell.gif', // Use a URL in the icon config
  480. tooltip: 'Sell stock',
  481. handler: function(grid, rowIndex, colIndex) {
  482. var rec = store.getAt(rowIndex);
  483. alert(&quot;Sell &quot; + rec.get('company'));
  484. }
  485. },
  486. {
  487. getClass: function(v, meta, rec) { // Or return a class from a function
  488. if (rec.get('change') &lt; 0) {
  489. this.items[1].tooltip = 'Do not buy!';
  490. return 'alert-col';
  491. } else {
  492. this.items[1].tooltip = 'Buy stock';
  493. return 'buy-col';
  494. }
  495. },
  496. handler: function(grid, rowIndex, colIndex) {
  497. var rec = store.getAt(rowIndex);
  498. alert(&quot;Buy &quot; + rec.get('company'));
  499. }
  500. }
  501. ]
  502. }
  503. //any other columns here
  504. ]
  505. });
  506. &lt;/pre&gt;&lt;/code&gt;
  507. * &lt;p&gt;The action column can be at any index in the columns array, and a grid can have any number of
  508. * action columns. &lt;/p&gt;
  509. */
  510. Ext.grid.ActionColumn = Ext.extend(Ext.grid.Column, {
  511. <span id='Ext-grid-ActionColumn-cfg-icon'> /**
  512. </span> * @cfg {String} icon
  513. * The URL of an image to display as the clickable element in the column.
  514. * Optional - defaults to &lt;code&gt;{@link Ext#BLANK_IMAGE_URL Ext.BLANK_IMAGE_URL}&lt;/code&gt;.
  515. */
  516. <span id='Ext-grid-ActionColumn-cfg-iconCls'> /**
  517. </span> * @cfg {String} iconCls
  518. * A CSS class to apply to the icon image. To determine the class dynamically, configure the Column with a &lt;code&gt;{@link #getClass}&lt;/code&gt; function.
  519. */
  520. <span id='Ext-grid-ActionColumn-cfg-handler'> /**
  521. </span> * @cfg {Function} handler A function called when the icon is clicked.
  522. * The handler is passed the following parameters:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  523. * &lt;li&gt;&lt;code&gt;grid&lt;/code&gt; : GridPanel&lt;div class=&quot;sub-desc&quot;&gt;The owning GridPanel.&lt;/div&gt;&lt;/li&gt;
  524. * &lt;li&gt;&lt;code&gt;rowIndex&lt;/code&gt; : Number&lt;div class=&quot;sub-desc&quot;&gt;The row index clicked on.&lt;/div&gt;&lt;/li&gt;
  525. * &lt;li&gt;&lt;code&gt;colIndex&lt;/code&gt; : Number&lt;div class=&quot;sub-desc&quot;&gt;The column index clicked on.&lt;/div&gt;&lt;/li&gt;
  526. * &lt;li&gt;&lt;code&gt;item&lt;/code&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The clicked item (or this Column if multiple
  527. * {@link #items} were not configured).&lt;/div&gt;&lt;/li&gt;
  528. * &lt;li&gt;&lt;code&gt;e&lt;/code&gt; : Event&lt;div class=&quot;sub-desc&quot;&gt;The click event.&lt;/div&gt;&lt;/li&gt;
  529. * &lt;/ul&gt;&lt;/div&gt;
  530. */
  531. <span id='Ext-grid-ActionColumn-cfg-scope'> /**
  532. </span> * @cfg {Object} scope The scope (&lt;tt&gt;&lt;b&gt;this&lt;/b&gt;&lt;/tt&gt; reference) in which the &lt;code&gt;{@link #handler}&lt;/code&gt;
  533. * and &lt;code&gt;{@link #getClass}&lt;/code&gt; fuctions are executed. Defaults to this Column.
  534. */
  535. <span id='Ext-grid-ActionColumn-cfg-tooltip'> /**
  536. </span> * @cfg {String} tooltip A tooltip message to be displayed on hover. {@link Ext.QuickTips#init Ext.QuickTips} must have
  537. * been initialized.
  538. */
  539. <span id='Ext-grid-ActionColumn-cfg-stopSelection'> /**
  540. </span> * @cfg {Boolean} stopSelection Defaults to &lt;code&gt;true&lt;/code&gt;. Prevent grid &lt;i&gt;row&lt;/i&gt; selection upon mousedown.
  541. */
  542. <span id='Ext-grid-ActionColumn-cfg-getClass'> /**
  543. </span> * @cfg {Function} getClass A function which returns the CSS class to apply to the icon image.
  544. * The function is passed the following parameters:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  545. * &lt;li&gt;&lt;b&gt;v&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;The value of the column's configured field (if any).&lt;/p&gt;&lt;/li&gt;
  546. * &lt;li&gt;&lt;b&gt;metadata&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;An object in which you may set the following attributes:&lt;ul&gt;
  547. * &lt;li&gt;&lt;b&gt;css&lt;/b&gt; : String&lt;p class=&quot;sub-desc&quot;&gt;A CSS class name to add to the cell's TD element.&lt;/p&gt;&lt;/li&gt;
  548. * &lt;li&gt;&lt;b&gt;attr&lt;/b&gt; : String&lt;p class=&quot;sub-desc&quot;&gt;An HTML attribute definition string to apply to the data container element &lt;i&gt;within&lt;/i&gt; the table cell
  549. * (e.g. 'style=&quot;color:red;&quot;').&lt;/p&gt;&lt;/li&gt;
  550. * &lt;/ul&gt;&lt;/p&gt;&lt;/li&gt;
  551. * &lt;li&gt;&lt;b&gt;r&lt;/b&gt; : Ext.data.Record&lt;p class=&quot;sub-desc&quot;&gt;The Record providing the data.&lt;/p&gt;&lt;/li&gt;
  552. * &lt;li&gt;&lt;b&gt;rowIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;The row index..&lt;/p&gt;&lt;/li&gt;
  553. * &lt;li&gt;&lt;b&gt;colIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;The column index.&lt;/p&gt;&lt;/li&gt;
  554. * &lt;li&gt;&lt;b&gt;store&lt;/b&gt; : Ext.data.Store&lt;p class=&quot;sub-desc&quot;&gt;The Store which is providing the data Model.&lt;/p&gt;&lt;/li&gt;
  555. * &lt;/ul&gt;&lt;/div&gt;
  556. */
  557. <span id='Ext-grid-ActionColumn-cfg-items'> /**
  558. </span> * @cfg {Array} items An Array which may contain multiple icon definitions, each element of which may contain:
  559. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  560. * &lt;li&gt;&lt;code&gt;icon&lt;/code&gt; : String&lt;div class=&quot;sub-desc&quot;&gt;The url of an image to display as the clickable element
  561. * in the column.&lt;/div&gt;&lt;/li&gt;
  562. * &lt;li&gt;&lt;code&gt;iconCls&lt;/code&gt; : String&lt;div class=&quot;sub-desc&quot;&gt;A CSS class to apply to the icon image.
  563. * To determine the class dynamically, configure the item with a &lt;code&gt;getClass&lt;/code&gt; function.&lt;/div&gt;&lt;/li&gt;
  564. * &lt;li&gt;&lt;code&gt;getClass&lt;/code&gt; : Function&lt;div class=&quot;sub-desc&quot;&gt;A function which returns the CSS class to apply to the icon image.
  565. * The function is passed the following parameters:&lt;ul&gt;
  566. * &lt;li&gt;&lt;b&gt;v&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;The value of the column's configured field (if any).&lt;/p&gt;&lt;/li&gt;
  567. * &lt;li&gt;&lt;b&gt;metadata&lt;/b&gt; : Object&lt;p class=&quot;sub-desc&quot;&gt;An object in which you may set the following attributes:&lt;ul&gt;
  568. * &lt;li&gt;&lt;b&gt;css&lt;/b&gt; : String&lt;p class=&quot;sub-desc&quot;&gt;A CSS class name to add to the cell's TD element.&lt;/p&gt;&lt;/li&gt;
  569. * &lt;li&gt;&lt;b&gt;attr&lt;/b&gt; : String&lt;p class=&quot;sub-desc&quot;&gt;An HTML attribute definition string to apply to the data container element &lt;i&gt;within&lt;/i&gt; the table cell
  570. * (e.g. 'style=&quot;color:red;&quot;').&lt;/p&gt;&lt;/li&gt;
  571. * &lt;/ul&gt;&lt;/p&gt;&lt;/li&gt;
  572. * &lt;li&gt;&lt;b&gt;r&lt;/b&gt; : Ext.data.Record&lt;p class=&quot;sub-desc&quot;&gt;The Record providing the data.&lt;/p&gt;&lt;/li&gt;
  573. * &lt;li&gt;&lt;b&gt;rowIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;The row index..&lt;/p&gt;&lt;/li&gt;
  574. * &lt;li&gt;&lt;b&gt;colIndex&lt;/b&gt; : Number&lt;p class=&quot;sub-desc&quot;&gt;The column index.&lt;/p&gt;&lt;/li&gt;
  575. * &lt;li&gt;&lt;b&gt;store&lt;/b&gt; : Ext.data.Store&lt;p class=&quot;sub-desc&quot;&gt;The Store which is providing the data Model.&lt;/p&gt;&lt;/li&gt;
  576. * &lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
  577. * &lt;li&gt;&lt;code&gt;handler&lt;/code&gt; : Function&lt;div class=&quot;sub-desc&quot;&gt;A function called when the icon is clicked.&lt;/div&gt;&lt;/li&gt;
  578. * &lt;li&gt;&lt;code&gt;scope&lt;/code&gt; : Scope&lt;div class=&quot;sub-desc&quot;&gt;The scope (&lt;code&gt;&lt;b&gt;this&lt;/b&gt;&lt;/code&gt; reference) in which the
  579. * &lt;code&gt;handler&lt;/code&gt; and &lt;code&gt;getClass&lt;/code&gt; functions are executed. Fallback defaults are this Column's
  580. * configured scope, then this Column.&lt;/div&gt;&lt;/li&gt;
  581. * &lt;li&gt;&lt;code&gt;tooltip&lt;/code&gt; : String&lt;div class=&quot;sub-desc&quot;&gt;A tooltip message to be displayed on hover.
  582. * {@link Ext.QuickTips#init Ext.QuickTips} must have been initialized.&lt;/div&gt;&lt;/li&gt;
  583. * &lt;/ul&gt;&lt;/div&gt;
  584. */
  585. header: '&amp;#160;',
  586. <span id='Ext-grid-ActionColumn-property-actionIdRe'> actionIdRe: /x-action-col-(\d+)/,
  587. </span>
  588. <span id='Ext-grid-ActionColumn-cfg-altText'> /**
  589. </span> * @cfg {String} altText The alt text to use for the image element. Defaults to &lt;tt&gt;''&lt;/tt&gt;.
  590. */
  591. altText: '',
  592. <span id='Ext-grid-ActionColumn-method-constructor'> constructor: function(cfg) {
  593. </span> var me = this,
  594. items = cfg.items || (me.items = [me]),
  595. l = items.length,
  596. i,
  597. item;
  598. Ext.grid.ActionColumn.superclass.constructor.call(me, cfg);
  599. // Renderer closure iterates through items creating an &lt;img&gt; element for each and tagging with an identifying
  600. // class name x-action-col-{n}
  601. me.renderer = function(v, meta) {
  602. // Allow a configured renderer to create initial value (And set the other values in the &quot;metadata&quot; argument!)
  603. v = Ext.isFunction(cfg.renderer) ? cfg.renderer.apply(this, arguments)||'' : '';
  604. meta.css += ' x-action-col-cell';
  605. for (i = 0; i &lt; l; i++) {
  606. item = items[i];
  607. v += '&lt;img alt=&quot;' + (item.altText || me.altText) + '&quot; src=&quot;' + (item.icon || Ext.BLANK_IMAGE_URL) +
  608. '&quot; class=&quot;x-action-col-icon x-action-col-' + String(i) + ' ' + (item.iconCls || '') +
  609. ' ' + (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope||this.scope||this, arguments) : '') + '&quot;' +
  610. ((item.tooltip) ? ' ext:qtip=&quot;' + item.tooltip + '&quot;' : '') + ' /&gt;';
  611. }
  612. return v;
  613. };
  614. },
  615. <span id='Ext-grid-ActionColumn-method-destroy'> destroy: function() {
  616. </span> delete this.items;
  617. delete this.renderer;
  618. return Ext.grid.ActionColumn.superclass.destroy.apply(this, arguments);
  619. },
  620. <span id='Ext-grid-ActionColumn-method-processEvent'> /**
  621. </span> * @private
  622. * Process and refire events routed from the GridView's processEvent method.
  623. * Also fires any configured click handlers. By default, cancels the mousedown event to prevent selection.
  624. * Returns the event handler's status to allow cancelling of GridView's bubbling process.
  625. */
  626. processEvent : function(name, e, grid, rowIndex, colIndex){
  627. var m = e.getTarget().className.match(this.actionIdRe),
  628. item, fn;
  629. if (m &amp;&amp; (item = this.items[parseInt(m[1], 10)])) {
  630. if (name == 'click') {
  631. (fn = item.handler || this.handler) &amp;&amp; fn.call(item.scope||this.scope||this, grid, rowIndex, colIndex, item, e);
  632. } else if ((name == 'mousedown') &amp;&amp; (item.stopSelection !== false)) {
  633. return false;
  634. }
  635. }
  636. return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments);
  637. }
  638. });
  639. /*
  640. * @property types
  641. * @type Object
  642. * @member Ext.grid.Column
  643. * @static
  644. * &lt;p&gt;An object containing predefined Column classes keyed by a mnemonic code which may be referenced
  645. * by the {@link Ext.grid.ColumnModel#xtype xtype} config option of ColumnModel.&lt;/p&gt;
  646. * &lt;p&gt;This contains the following properties&lt;/p&gt;&lt;div class=&quot;mdesc-details&quot;&gt;&lt;ul&gt;
  647. * &lt;li&gt;gridcolumn : &lt;b&gt;{@link Ext.grid.Column Column constructor}&lt;/b&gt;&lt;/li&gt;
  648. * &lt;li&gt;booleancolumn : &lt;b&gt;{@link Ext.grid.BooleanColumn BooleanColumn constructor}&lt;/b&gt;&lt;/li&gt;
  649. * &lt;li&gt;numbercolumn : &lt;b&gt;{@link Ext.grid.NumberColumn NumberColumn constructor}&lt;/b&gt;&lt;/li&gt;
  650. * &lt;li&gt;datecolumn : &lt;b&gt;{@link Ext.grid.DateColumn DateColumn constructor}&lt;/b&gt;&lt;/li&gt;
  651. * &lt;li&gt;templatecolumn : &lt;b&gt;{@link Ext.grid.TemplateColumn TemplateColumn constructor}&lt;/b&gt;&lt;/li&gt;
  652. * &lt;/ul&gt;&lt;/div&gt;
  653. */
  654. Ext.grid.Column.types = {
  655. gridcolumn : Ext.grid.Column,
  656. booleancolumn: Ext.grid.BooleanColumn,
  657. numbercolumn: Ext.grid.NumberColumn,
  658. datecolumn: Ext.grid.DateColumn,
  659. templatecolumn: Ext.grid.TemplateColumn,
  660. actioncolumn: Ext.grid.ActionColumn
  661. };</pre>
  662. </body>
  663. </html>