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.

555 lines
21 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-RowSelectionModel-method-constructor'><span id='Ext-grid-RowSelectionModel'>/**
  19. </span></span> * @class Ext.grid.RowSelectionModel
  20. * @extends Ext.grid.AbstractSelectionModel
  21. * The default SelectionModel used by {@link Ext.grid.GridPanel}.
  22. * It supports multiple selections and keyboard selection/navigation. The objects stored
  23. * as selections and returned by {@link #getSelected}, and {@link #getSelections} are
  24. * the {@link Ext.data.Record Record}s which provide the data for the selected rows.
  25. * @constructor
  26. * @param {Object} config
  27. */
  28. Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
  29. <span id='Ext-grid-RowSelectionModel-cfg-singleSelect'> /**
  30. </span> * @cfg {Boolean} singleSelect
  31. * &lt;tt&gt;true&lt;/tt&gt; to allow selection of only one row at a time (defaults to &lt;tt&gt;false&lt;/tt&gt;
  32. * allowing multiple selections)
  33. */
  34. singleSelect : false,
  35. constructor : function(config){
  36. Ext.apply(this, config);
  37. this.selections = new Ext.util.MixedCollection(false, function(o){
  38. return o.id;
  39. });
  40. this.last = false;
  41. this.lastActive = false;
  42. this.addEvents(
  43. <span id='Ext-grid-RowSelectionModel-event-selectionchange'> /**
  44. </span> * @event selectionchange
  45. * Fires when the selection changes
  46. * @param {SelectionModel} this
  47. */
  48. 'selectionchange',
  49. <span id='Ext-grid-RowSelectionModel-event-beforerowselect'> /**
  50. </span> * @event beforerowselect
  51. * Fires before a row is selected, return false to cancel the selection.
  52. * @param {SelectionModel} this
  53. * @param {Number} rowIndex The index to be selected
  54. * @param {Boolean} keepExisting False if other selections will be cleared
  55. * @param {Record} record The record to be selected
  56. */
  57. 'beforerowselect',
  58. <span id='Ext-grid-RowSelectionModel-event-rowselect'> /**
  59. </span> * @event rowselect
  60. * Fires when a row is selected.
  61. * @param {SelectionModel} this
  62. * @param {Number} rowIndex The selected index
  63. * @param {Ext.data.Record} r The selected record
  64. */
  65. 'rowselect',
  66. <span id='Ext-grid-RowSelectionModel-event-rowdeselect'> /**
  67. </span> * @event rowdeselect
  68. * Fires when a row is deselected. To prevent deselection
  69. * {@link Ext.grid.AbstractSelectionModel#lock lock the selections}.
  70. * @param {SelectionModel} this
  71. * @param {Number} rowIndex
  72. * @param {Record} record
  73. */
  74. 'rowdeselect'
  75. );
  76. Ext.grid.RowSelectionModel.superclass.constructor.call(this);
  77. },
  78. <span id='Ext-grid-RowSelectionModel-cfg-moveEditorOnEnter'> /**
  79. </span> * @cfg {Boolean} moveEditorOnEnter
  80. * &lt;tt&gt;false&lt;/tt&gt; to turn off moving the editor to the next row down when the enter key is pressed
  81. * or the next row up when shift + enter keys are pressed.
  82. */
  83. <span id='Ext-grid-RowSelectionModel-method-initEvents'> // private
  84. </span> initEvents : function(){
  85. if(!this.grid.enableDragDrop &amp;&amp; !this.grid.enableDrag){
  86. this.grid.on('rowmousedown', this.handleMouseDown, this);
  87. }
  88. this.rowNav = new Ext.KeyNav(this.grid.getGridEl(), {
  89. up: this.onKeyPress,
  90. down: this.onKeyPress,
  91. scope: this
  92. });
  93. this.grid.getView().on({
  94. scope: this,
  95. refresh: this.onRefresh,
  96. rowupdated: this.onRowUpdated,
  97. rowremoved: this.onRemove
  98. });
  99. },
  100. <span id='Ext-grid-RowSelectionModel-method-onKeyPress'> onKeyPress : function(e, name){
  101. </span> var up = name == 'up',
  102. method = up ? 'selectPrevious' : 'selectNext',
  103. add = up ? -1 : 1,
  104. last;
  105. if(!e.shiftKey || this.singleSelect){
  106. this[method](false);
  107. }else if(this.last !== false &amp;&amp; this.lastActive !== false){
  108. last = this.last;
  109. this.selectRange(this.last, this.lastActive + add);
  110. this.grid.getView().focusRow(this.lastActive);
  111. if(last !== false){
  112. this.last = last;
  113. }
  114. }else{
  115. this.selectFirstRow();
  116. }
  117. },
  118. <span id='Ext-grid-RowSelectionModel-method-onRefresh'> // private
  119. </span> onRefresh : function(){
  120. var ds = this.grid.store,
  121. s = this.getSelections(),
  122. i = 0,
  123. len = s.length,
  124. index, r;
  125. this.silent = true;
  126. this.clearSelections(true);
  127. for(; i &lt; len; i++){
  128. r = s[i];
  129. if((index = ds.indexOfId(r.id)) != -1){
  130. this.selectRow(index, true);
  131. }
  132. }
  133. if(s.length != this.selections.getCount()){
  134. this.fireEvent('selectionchange', this);
  135. }
  136. this.silent = false;
  137. },
  138. <span id='Ext-grid-RowSelectionModel-method-onRemove'> // private
  139. </span> onRemove : function(v, index, r){
  140. if(this.selections.remove(r) !== false){
  141. this.fireEvent('selectionchange', this);
  142. }
  143. },
  144. <span id='Ext-grid-RowSelectionModel-method-onRowUpdated'> // private
  145. </span> onRowUpdated : function(v, index, r){
  146. if(this.isSelected(r)){
  147. v.onRowSelect(index);
  148. }
  149. },
  150. <span id='Ext-grid-RowSelectionModel-method-selectRecords'> /**
  151. </span> * Select records.
  152. * @param {Array} records The records to select
  153. * @param {Boolean} keepExisting (optional) &lt;tt&gt;true&lt;/tt&gt; to keep existing selections
  154. */
  155. selectRecords : function(records, keepExisting){
  156. if(!keepExisting){
  157. this.clearSelections();
  158. }
  159. var ds = this.grid.store,
  160. i = 0,
  161. len = records.length;
  162. for(; i &lt; len; i++){
  163. this.selectRow(ds.indexOf(records[i]), true);
  164. }
  165. },
  166. <span id='Ext-grid-RowSelectionModel-method-getCount'> /**
  167. </span> * Gets the number of selected rows.
  168. * @return {Number}
  169. */
  170. getCount : function(){
  171. return this.selections.length;
  172. },
  173. <span id='Ext-grid-RowSelectionModel-method-selectFirstRow'> /**
  174. </span> * Selects the first row in the grid.
  175. */
  176. selectFirstRow : function(){
  177. this.selectRow(0);
  178. },
  179. <span id='Ext-grid-RowSelectionModel-method-selectLastRow'> /**
  180. </span> * Select the last row.
  181. * @param {Boolean} keepExisting (optional) &lt;tt&gt;true&lt;/tt&gt; to keep existing selections
  182. */
  183. selectLastRow : function(keepExisting){
  184. this.selectRow(this.grid.store.getCount() - 1, keepExisting);
  185. },
  186. <span id='Ext-grid-RowSelectionModel-method-selectNext'> /**
  187. </span> * Selects the row immediately following the last selected row.
  188. * @param {Boolean} keepExisting (optional) &lt;tt&gt;true&lt;/tt&gt; to keep existing selections
  189. * @return {Boolean} &lt;tt&gt;true&lt;/tt&gt; if there is a next row, else &lt;tt&gt;false&lt;/tt&gt;
  190. */
  191. selectNext : function(keepExisting){
  192. if(this.hasNext()){
  193. this.selectRow(this.last+1, keepExisting);
  194. this.grid.getView().focusRow(this.last);
  195. return true;
  196. }
  197. return false;
  198. },
  199. <span id='Ext-grid-RowSelectionModel-method-selectPrevious'> /**
  200. </span> * Selects the row that precedes the last selected row.
  201. * @param {Boolean} keepExisting (optional) &lt;tt&gt;true&lt;/tt&gt; to keep existing selections
  202. * @return {Boolean} &lt;tt&gt;true&lt;/tt&gt; if there is a previous row, else &lt;tt&gt;false&lt;/tt&gt;
  203. */
  204. selectPrevious : function(keepExisting){
  205. if(this.hasPrevious()){
  206. this.selectRow(this.last-1, keepExisting);
  207. this.grid.getView().focusRow(this.last);
  208. return true;
  209. }
  210. return false;
  211. },
  212. <span id='Ext-grid-RowSelectionModel-method-hasNext'> /**
  213. </span> * Returns true if there is a next record to select
  214. * @return {Boolean}
  215. */
  216. hasNext : function(){
  217. return this.last !== false &amp;&amp; (this.last+1) &lt; this.grid.store.getCount();
  218. },
  219. <span id='Ext-grid-RowSelectionModel-method-hasPrevious'> /**
  220. </span> * Returns true if there is a previous record to select
  221. * @return {Boolean}
  222. */
  223. hasPrevious : function(){
  224. return !!this.last;
  225. },
  226. <span id='Ext-grid-RowSelectionModel-method-getSelections'> /**
  227. </span> * Returns the selected records
  228. * @return {Array} Array of selected records
  229. */
  230. getSelections : function(){
  231. return [].concat(this.selections.items);
  232. },
  233. <span id='Ext-grid-RowSelectionModel-method-getSelected'> /**
  234. </span> * Returns the first selected record.
  235. * @return {Record}
  236. */
  237. getSelected : function(){
  238. return this.selections.itemAt(0);
  239. },
  240. <span id='Ext-grid-RowSelectionModel-method-each'> /**
  241. </span> * Calls the passed function with each selection. If the function returns
  242. * &lt;tt&gt;false&lt;/tt&gt;, iteration is stopped and this function returns
  243. * &lt;tt&gt;false&lt;/tt&gt;. Otherwise it returns &lt;tt&gt;true&lt;/tt&gt;.
  244. * @param {Function} fn The function to call upon each iteration. It is passed the selected {@link Ext.data.Record Record}.
  245. * @param {Object} scope (optional) The scope (&lt;code&gt;this&lt;/code&gt; reference) in which the function is executed. Defaults to this RowSelectionModel.
  246. * @return {Boolean} true if all selections were iterated
  247. */
  248. each : function(fn, scope){
  249. var s = this.getSelections(),
  250. i = 0,
  251. len = s.length;
  252. for(; i &lt; len; i++){
  253. if(fn.call(scope || this, s[i], i) === false){
  254. return false;
  255. }
  256. }
  257. return true;
  258. },
  259. <span id='Ext-grid-RowSelectionModel-method-clearSelections'> /**
  260. </span> * Clears all selections if the selection model
  261. * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}.
  262. * @param {Boolean} fast (optional) &lt;tt&gt;true&lt;/tt&gt; to bypass the
  263. * conditional checks and events described in {@link #deselectRow}.
  264. */
  265. clearSelections : function(fast){
  266. if(this.isLocked()){
  267. return;
  268. }
  269. if(fast !== true){
  270. var ds = this.grid.store,
  271. s = this.selections;
  272. s.each(function(r){
  273. this.deselectRow(ds.indexOfId(r.id));
  274. }, this);
  275. s.clear();
  276. }else{
  277. this.selections.clear();
  278. }
  279. this.last = false;
  280. },
  281. <span id='Ext-grid-RowSelectionModel-method-selectAll'> /**
  282. </span> * Selects all rows if the selection model
  283. * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}.
  284. */
  285. selectAll : function(){
  286. if(this.isLocked()){
  287. return;
  288. }
  289. this.selections.clear();
  290. for(var i = 0, len = this.grid.store.getCount(); i &lt; len; i++){
  291. this.selectRow(i, true);
  292. }
  293. },
  294. <span id='Ext-grid-RowSelectionModel-method-hasSelection'> /**
  295. </span> * Returns &lt;tt&gt;true&lt;/tt&gt; if there is a selection.
  296. * @return {Boolean}
  297. */
  298. hasSelection : function(){
  299. return this.selections.length &gt; 0;
  300. },
  301. <span id='Ext-grid-RowSelectionModel-method-isSelected'> /**
  302. </span> * Returns &lt;tt&gt;true&lt;/tt&gt; if the specified row is selected.
  303. * @param {Number/Record} index The record or index of the record to check
  304. * @return {Boolean}
  305. */
  306. isSelected : function(index){
  307. var r = Ext.isNumber(index) ? this.grid.store.getAt(index) : index;
  308. return (r &amp;&amp; this.selections.key(r.id) ? true : false);
  309. },
  310. <span id='Ext-grid-RowSelectionModel-method-isIdSelected'> /**
  311. </span> * Returns &lt;tt&gt;true&lt;/tt&gt; if the specified record id is selected.
  312. * @param {String} id The id of record to check
  313. * @return {Boolean}
  314. */
  315. isIdSelected : function(id){
  316. return (this.selections.key(id) ? true : false);
  317. },
  318. <span id='Ext-grid-RowSelectionModel-method-handleMouseDown'> // private
  319. </span> handleMouseDown : function(g, rowIndex, e){
  320. if(e.button !== 0 || this.isLocked()){
  321. return;
  322. }
  323. var view = this.grid.getView();
  324. if(e.shiftKey &amp;&amp; !this.singleSelect &amp;&amp; this.last !== false){
  325. var last = this.last;
  326. this.selectRange(last, rowIndex, e.ctrlKey);
  327. this.last = last; // reset the last
  328. view.focusRow(rowIndex);
  329. }else{
  330. var isSelected = this.isSelected(rowIndex);
  331. if(e.ctrlKey &amp;&amp; isSelected){
  332. this.deselectRow(rowIndex);
  333. }else if(!isSelected || this.getCount() &gt; 1){
  334. this.selectRow(rowIndex, e.ctrlKey || e.shiftKey);
  335. view.focusRow(rowIndex);
  336. }
  337. }
  338. },
  339. <span id='Ext-grid-RowSelectionModel-method-selectRows'> /**
  340. </span> * Selects multiple rows.
  341. * @param {Array} rows Array of the indexes of the row to select
  342. * @param {Boolean} keepExisting (optional) &lt;tt&gt;true&lt;/tt&gt; to keep
  343. * existing selections (defaults to &lt;tt&gt;false&lt;/tt&gt;)
  344. */
  345. selectRows : function(rows, keepExisting){
  346. if(!keepExisting){
  347. this.clearSelections();
  348. }
  349. for(var i = 0, len = rows.length; i &lt; len; i++){
  350. this.selectRow(rows[i], true);
  351. }
  352. },
  353. <span id='Ext-grid-RowSelectionModel-method-selectRange'> /**
  354. </span> * Selects a range of rows if the selection model
  355. * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}.
  356. * All rows in between startRow and endRow are also selected.
  357. * @param {Number} startRow The index of the first row in the range
  358. * @param {Number} endRow The index of the last row in the range
  359. * @param {Boolean} keepExisting (optional) True to retain existing selections
  360. */
  361. selectRange : function(startRow, endRow, keepExisting){
  362. var i;
  363. if(this.isLocked()){
  364. return;
  365. }
  366. if(!keepExisting){
  367. this.clearSelections();
  368. }
  369. if(startRow &lt;= endRow){
  370. for(i = startRow; i &lt;= endRow; i++){
  371. this.selectRow(i, true);
  372. }
  373. }else{
  374. for(i = startRow; i &gt;= endRow; i--){
  375. this.selectRow(i, true);
  376. }
  377. }
  378. },
  379. <span id='Ext-grid-RowSelectionModel-method-deselectRange'> /**
  380. </span> * Deselects a range of rows if the selection model
  381. * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}.
  382. * All rows in between startRow and endRow are also deselected.
  383. * @param {Number} startRow The index of the first row in the range
  384. * @param {Number} endRow The index of the last row in the range
  385. */
  386. deselectRange : function(startRow, endRow, preventViewNotify){
  387. if(this.isLocked()){
  388. return;
  389. }
  390. for(var i = startRow; i &lt;= endRow; i++){
  391. this.deselectRow(i, preventViewNotify);
  392. }
  393. },
  394. <span id='Ext-grid-RowSelectionModel-method-selectRow'> /**
  395. </span> * Selects a row. Before selecting a row, checks if the selection model
  396. * {@link Ext.grid.AbstractSelectionModel#isLocked is locked} and fires the
  397. * {@link #beforerowselect} event. If these checks are satisfied the row
  398. * will be selected and followed up by firing the {@link #rowselect} and
  399. * {@link #selectionchange} events.
  400. * @param {Number} row The index of the row to select
  401. * @param {Boolean} keepExisting (optional) &lt;tt&gt;true&lt;/tt&gt; to keep existing selections
  402. * @param {Boolean} preventViewNotify (optional) Specify &lt;tt&gt;true&lt;/tt&gt; to
  403. * prevent notifying the view (disables updating the selected appearance)
  404. */
  405. selectRow : function(index, keepExisting, preventViewNotify){
  406. if(this.isLocked() || (index &lt; 0 || index &gt;= this.grid.store.getCount()) || (keepExisting &amp;&amp; this.isSelected(index))){
  407. return;
  408. }
  409. var r = this.grid.store.getAt(index);
  410. if(r &amp;&amp; this.fireEvent('beforerowselect', this, index, keepExisting, r) !== false){
  411. if(!keepExisting || this.singleSelect){
  412. this.clearSelections();
  413. }
  414. this.selections.add(r);
  415. this.last = this.lastActive = index;
  416. if(!preventViewNotify){
  417. this.grid.getView().onRowSelect(index);
  418. }
  419. if(!this.silent){
  420. this.fireEvent('rowselect', this, index, r);
  421. this.fireEvent('selectionchange', this);
  422. }
  423. }
  424. },
  425. <span id='Ext-grid-RowSelectionModel-method-deselectRow'> /**
  426. </span> * Deselects a row. Before deselecting a row, checks if the selection model
  427. * {@link Ext.grid.AbstractSelectionModel#isLocked is locked}.
  428. * If this check is satisfied the row will be deselected and followed up by
  429. * firing the {@link #rowdeselect} and {@link #selectionchange} events.
  430. * @param {Number} row The index of the row to deselect
  431. * @param {Boolean} preventViewNotify (optional) Specify &lt;tt&gt;true&lt;/tt&gt; to
  432. * prevent notifying the view (disables updating the selected appearance)
  433. */
  434. deselectRow : function(index, preventViewNotify){
  435. if(this.isLocked()){
  436. return;
  437. }
  438. if(this.last == index){
  439. this.last = false;
  440. }
  441. if(this.lastActive == index){
  442. this.lastActive = false;
  443. }
  444. var r = this.grid.store.getAt(index);
  445. if(r){
  446. this.selections.remove(r);
  447. if(!preventViewNotify){
  448. this.grid.getView().onRowDeselect(index);
  449. }
  450. this.fireEvent('rowdeselect', this, index, r);
  451. this.fireEvent('selectionchange', this);
  452. }
  453. },
  454. <span id='Ext-grid-RowSelectionModel-method-acceptsNav'> // private
  455. </span> acceptsNav : function(row, col, cm){
  456. return !cm.isHidden(col) &amp;&amp; cm.isCellEditable(col, row);
  457. },
  458. <span id='Ext-grid-RowSelectionModel-method-onEditorKey'> // private
  459. </span> onEditorKey : function(field, e){
  460. var k = e.getKey(),
  461. newCell,
  462. g = this.grid,
  463. last = g.lastEdit,
  464. ed = g.activeEditor,
  465. shift = e.shiftKey,
  466. ae, last, r, c;
  467. if(k == e.TAB){
  468. e.stopEvent();
  469. ed.completeEdit();
  470. if(shift){
  471. newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
  472. }else{
  473. newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
  474. }
  475. }else if(k == e.ENTER){
  476. if(this.moveEditorOnEnter !== false){
  477. if(shift){
  478. newCell = g.walkCells(last.row - 1, last.col, -1, this.acceptsNav, this);
  479. }else{
  480. newCell = g.walkCells(last.row + 1, last.col, 1, this.acceptsNav, this);
  481. }
  482. }
  483. }
  484. if(newCell){
  485. r = newCell[0];
  486. c = newCell[1];
  487. this.onEditorSelect(r, last.row);
  488. if(g.isEditor &amp;&amp; g.editing){ // *** handle tabbing while editorgrid is in edit mode
  489. ae = g.activeEditor;
  490. if(ae &amp;&amp; ae.field.triggerBlur){
  491. // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method
  492. ae.field.triggerBlur();
  493. }
  494. }
  495. g.startEditing(r, c);
  496. }
  497. },
  498. <span id='Ext-grid-RowSelectionModel-method-onEditorSelect'> onEditorSelect: function(row, lastRow){
  499. </span> if(lastRow != row){
  500. this.selectRow(row); // *** highlight newly-selected cell and update selection
  501. }
  502. },
  503. <span id='Ext-grid-RowSelectionModel-method-destroy'> destroy : function(){
  504. </span> Ext.destroy(this.rowNav);
  505. this.rowNav = null;
  506. Ext.grid.RowSelectionModel.superclass.destroy.call(this);
  507. }
  508. });
  509. </pre>
  510. </body>
  511. </html>