Changeset 31
- Timestamp:
- 11/01/08 20:39:14 (4 years ago)
- google:author:
- tsuckowhomberg
- Location:
- trunk
- Files:
-
- 2 added
- 9 modified
-
CHANGELOG (modified) (1 diff)
-
README (modified) (1 diff)
-
src/DragZone.js (modified) (3 diffs)
-
src/EditorGridPanel.js (added)
-
src/GridPanel.js (added)
-
src/GridView.js (modified) (18 diffs)
-
src/JsonReader.js (modified) (2 diffs)
-
src/resources/css/ext-ux-livegrid.css (modified) (1 diff)
-
src/RowSelectionModel.js (modified) (4 diffs)
-
src/Store.js (modified) (3 diffs)
-
src/Toolbar.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r30 r31 1 - enhancement: removed programmatically invoking scroll in IE when the grid is rendered, 1 Version 0.3a2 (GPL) 2 1-November-2008 3 4 - enhancement: (Toolbar.js) config object allows now to specify either the grid 5 or the view the toolbar is bound to 6 - fixed: (Store.js) "getAt()" would return "-1" if the data at the passed index 7 could not be found in some cases; changed to return type "undefined" 8 - fixed: (GridView.js) overrode method "getCell()" to return "null" if the row 9 for the specified index could not be found 10 - fixed: firing of event "cursormove" would happen before "replaceLiveRows()" 11 has taken care of re-assigning the rowIndex to the rows in the view which could 12 lead to errors; adjusted method and made sure that "replaceLiveRows()" is called 13 first 14 - enhancement: (EditorGridPanel.js, GridPanel.js) added basic support for using 15 cell editors for the Livegrid (EditorGridPanel-support) 16 - enhancement: (ext-ux-livegrid.css, DragZone.js) minor code cleanups, changed 17 css class "x-dd-drop-waiting" to "ext-ux-livegrid-drop-waiting" 18 - enhancement: (GridView.js) added method "getRow()", removed overriden method 19 "onCellSelect()", "onCellDeselect()", "onRowOver()", "onRowOut()" and changed 20 arguments for call of methods that operate on Html-elements in the view to pass 21 the model index as specified in the elements "rowIndex"-property, which will get 22 translated internally to the html-element's index in the view, for broadening 23 compatibility to other plugins/exension, such as the EditorGridPanel 24 - enhancement: (GridView.js) changed behavior of "processRows()" to paint the selections 25 if the third argument does not equal to "false" 26 - enhancement: (RowSelectionModel.js) added method "deselectRecord()" to deselect a record 27 that is already selected in the model 28 - enhancement: (GridView.js) added method "isRecordRendered()" to check whether the passed 29 record is currently within the visible rect of the grid's view 30 - enhancement: removed programmatically invoking scroll in IE when the grid is rendered, 2 31 since this was fixed due to the css changes in a previously version 3 32 - fixed: (RowSelectionModel.js) method "isSelected()" would lose it's original argument -
trunk/README
r2 r31 6 6 ------------- 7 7 http://www.siteartwork.de/livegrid 8 9 History: 10 -------- 11 Ext.ux.Livegrid is a subproject of ongoo. Visit <http://www.ongoo.org> for 12 more informations. -
trunk/src/DragZone.js
r26 r31 7 7 * license. 8 8 * 9 * Commercial use is prohibited. Contact "Thorsten Suckow-Homberg" <ts@siteartwork.de>10 * if you need a commercial license.9 * Commercial use is prohibited. Visit <http://www.siteartwork.de/livegrid> 10 * if you need to obtain a commercial license. 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify it under … … 22 22 * this program. If not, see <http://www.gnu.org/licenses/gpl.html>. 23 23 * 24 * If you would like to support the development and support of the Ext.ux.Livegrid25 * component, you can make a donation: <http://www.siteartwork.de/livegrid>26 24 */ 27 25 … … 35 33 Ext.ux.grid.livegrid.DragZone = function(grid, config){ 36 34 37 this.view = grid.getView(); 38 Ext.ux.grid.livegrid.DragZone.superclass.constructor.call(this, this.view.mainBody.dom, config); 35 Ext.ux.grid.livegrid.DragZone.superclass.constructor.call(this, grid, config); 39 36 40 if(this.view.lockedBody){ 41 this.setHandleElId(Ext.id(this.view.mainBody.dom)); 42 this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom)); 43 } 44 45 this.scroll = false; 46 this.grid = grid; 47 this.ddel = document.createElement('div'); 48 49 this.ddel.className = 'x-grid-dd-wrap'; 50 51 this.view.ds.on('beforeselectionsload', this.onBeforeSelectionsLoad, this); 52 this.view.ds.on('selectionsload', this.onSelectionsLoad, this); 37 this.view.ds.on('beforeselectionsload', this._onBeforeSelectionsLoad, this); 38 this.view.ds.on('selectionsload', this._onSelectionsLoad, this); 53 39 }; 54 40 55 Ext.extend(Ext.ux.grid.livegrid.DragZone, Ext.dd.DragZone, { 56 ddGroup : "GridDD", 41 Ext.extend(Ext.ux.grid.livegrid.DragZone, Ext.grid.GridDragZone, { 57 42 43 /** 44 * Tells whether a drop is valid. Used inetrnally to determine if pending 45 * selections need to be loaded/ have been loaded. 46 * @type {Boolean} 47 */ 58 48 isDropValid : true, 59 49 60 getDragData : function(e) 61 { 62 var t = Ext.lib.Event.getTarget(e); 63 var rowIndex = this.view.findRowIndex(t); 64 if(rowIndex !== false){ 65 var sm = this.grid.selModel; 66 if(!sm.isSelected(rowIndex) || e.hasModifier()){ 67 sm.handleMouseDown(this.grid, rowIndex, e); 68 } 69 70 return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()}; 71 } 72 return false; 73 }, 74 50 /** 51 * Overriden for loading pending selections if needed. 52 */ 75 53 onInitDrag : function(e) 76 54 { 77 55 this.view.ds.loadSelections(this.grid.selModel.getPendingSelections(true)); 78 56 79 var data = this.dragData; 80 this.ddel.innerHTML = this.grid.getDragDropText(); 81 this.proxy.update(this.ddel); 57 Ext.ux.grid.livegrid.DragZone.superclass.onInitDrag.call(this, e); 82 58 }, 83 59 84 onBeforeSelectionsLoad : function() 60 /** 61 * Gets called before pending selections are loaded. Any drop 62 * operations are invalid/get paused if the component needs to 63 * wait for selections to load from the server. 64 * 65 */ 66 _onBeforeSelectionsLoad : function() 85 67 { 86 68 this.isDropValid = false; 87 Ext.fly(this.proxy.el.dom.firstChild).addClass(' x-dd-drop-waiting');69 Ext.fly(this.proxy.el.dom.firstChild).addClass('ext-ux-livegrid-drop-waiting'); 88 70 }, 89 71 90 onSelectionsLoad : function() 72 /** 73 * Gets called after pending selections have been loaded. 74 * Any paused drop operation will be resumed. 75 * 76 */ 77 _onSelectionsLoad : function() 91 78 { 92 79 this.isDropValid = true; 93 80 this.ddel.innerHTML = this.grid.getDragDropText(); 94 Ext.fly(this.proxy.el.dom.firstChild).removeClass('x-dd-drop-waiting'); 95 }, 96 97 afterRepair : function() 98 { 99 this.dragging = false; 100 }, 101 102 getRepairXY : function(e, data) 103 { 104 return false; 105 }, 106 107 onStartDrag : function() 108 { 109 110 }, 111 112 onEndDrag : function(data, e) 113 { 114 }, 115 116 onValidDrop : function(dd, e, id) 117 { 118 this.hideProxy(); 119 }, 120 121 beforeInvalidDrop : function(e, id) 122 { 123 81 Ext.fly(this.proxy.el.dom.firstChild).removeClass('ext-ux-livegrid-drop-waiting'); 124 82 } 125 83 }); -
trunk/src/GridView.js
r30 r31 7 7 * license. 8 8 * 9 * Commercial use is prohibited. Contact "Thorsten Suckow-Homberg" <ts@siteartwork.de>10 * if you need a commercial license.9 * Commercial use is prohibited. Visit <http://www.siteartwork.de/livegrid> 10 * if you need to obtain a commercial license. 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify it under … … 22 22 * this program. If not, see <http://www.gnu.org/licenses/gpl.html>. 23 23 * 24 * If you would like to support the development and support of the Ext.ux.Livegrid25 * component, you can make a donation: <http://www.siteartwork.de/livegrid>26 24 */ 27 25 … … 505 503 /** 506 504 * Overriden for Ext 2.2 to prevent call to focus Row. 507 * This method i s here for dom operations only - the passed argument is the508 * index of the node in the dom, not in the model.509 505 * 510 506 */ … … 578 574 /** 579 575 * Callback for selecting a row. The index of the row is the absolute index 580 * in the datamodel and gets translated to the index in the view. 581 * Overwrites the parent's implementation. 576 * in the datamodel. If the row is not rendered, this method will do nothing. 582 577 */ 583 578 // private … … 588 583 } 589 584 590 var viewIndex = row-this.rowIndex; 591 592 this.addRowClass(viewIndex, "x-grid3-row-selected"); 585 this.addRowClass(row, "x-grid3-row-selected"); 593 586 }, 594 587 595 588 /** 596 589 * Callback for deselecting a row. The index of the row is the absolute index 597 * in the datamodel and gets translated to the index in the view.598 * Overwrites the parent's implementation.590 * in the datamodel. If the row is not currently rendered in the view, this method 591 * will do nothing. 599 592 */ 600 593 // private … … 605 598 } 606 599 607 var viewIndex = row-this.rowIndex; 608 609 this.removeRowClass(viewIndex, "x-grid3-row-selected"); 610 }, 611 612 /** 613 * Callback for selecting a cell. The index of the row is the absolute index 614 * in the datamodel and gets translated to the index in the view. 615 * Overwrites the parent's implementation. 616 */ 617 // private 618 onCellSelect : function(row, col) 619 { 620 if (row < this.rowIndex || row > this.rowIndex+this.visibleRows) { 621 return; 622 } 623 624 var viewIndex = row-this.rowIndex; 625 626 var cell = this.getCell(viewIndex, col); 627 if(cell){ 628 this.fly(cell).addClass("x-grid3-cell-selected"); 629 } 630 }, 631 632 /** 633 * Callback for deselecting a cell. The index of the row is the absolute index 634 * in the datamodel and gets translated to the index in the view. 635 * Overwrites the parent's implementation. 636 */ 637 // private 638 onCellDeselect : function(row, col) 639 { 640 if (row < this.rowIndex || row > this.rowIndex+this.visibleRows) { 641 return; 642 } 643 644 var viewIndex = row-this.rowIndex; 645 646 var cell = this.getCell(viewIndex, col); 647 if(cell){ 648 this.fly(cell).removeClass("x-grid3-cell-selected"); 649 } 650 }, 651 652 /** 653 * Callback for onmouseover event of the grid's rows. The index of the row is 654 * the absolute index in the datamodel and gets translated to the index in the 655 * view. 656 * Overwrites the parent's implementation. 657 */ 658 // private 659 onRowOver : function(e, t) 660 { 661 var row; 662 if((row = this.findRowIndex(t)) !== false){ 663 var viewIndex = row-this.rowIndex; 664 this.addRowClass(viewIndex, "x-grid3-row-over"); 665 } 666 }, 667 668 /** 669 * Callback for onmouseout event of the grid's rows. The index of the row is 670 * the absolute index in the datamodel and gets translated to the index in the 671 * view. 672 * Overwrites the parent's implementation. 673 */ 674 // private 675 onRowOut : function(e, t) 676 { 677 var row; 678 if((row = this.findRowIndex(t)) !== false && row !== this.findRowIndex(e.getRelatedTarget())){ 679 var viewIndex = row-this.rowIndex; 680 this.removeRowClass(viewIndex, "x-grid3-row-over"); 681 } 600 this.removeRowClass(row, "x-grid3-row-selected"); 682 601 }, 683 602 … … 818 737 819 738 this.fireEvent("rowsinserted", this, index, index, recordLen); 820 this.processRows( );739 this.processRows(0, undefined, false); 821 740 // the cursor did virtually move 822 741 this.fireEvent('cursormove', this, this.rowIndex, … … 1051 970 1052 971 var cursor = Math.floor((scrollTop)/this.rowHeight); 972 1053 973 this.rowIndex = cursor; 1054 974 // the lastRowIndex will be set when refreshing the view has finished … … 1058 978 1059 979 this.updateLiveRows(cursor); 980 1060 981 this.lastScrollPos = this.liveScroller.dom.scrollTop; 1061 982 }, … … 1084 1005 1085 1006 this.insertRows(ds, index, index, true); 1086 //this.getRow(index).rowIndex = index;1087 //this.onRemove(ds, record, index+1, true);1088 1007 this.fireEvent("rowupdated", this, viewIndex, record); 1089 1008 }, … … 1115 1034 row.rowIndex = index; 1116 1035 1117 if (paintSelections == true) {1036 if (paintSelections !== false) { 1118 1037 if (this.grid.selModel.isSelected(this.ds.getAt(index)) === true) { 1119 this.addRowClass(i , "x-grid3-row-selected");1038 this.addRowClass(index, "x-grid3-row-selected"); 1120 1039 } else { 1121 this.removeRowClass(i , "x-grid3-row-selected");1040 this.removeRowClass(index, "x-grid3-row-selected"); 1122 1041 } 1123 1042 this.fly(row).removeClass("x-grid3-row-over"); … … 1171 1090 var html = this.renderRows(firstRow, lastRenderRow); 1172 1091 1173 var before = this.getRow( firstRow-(this.rowIndex-this.ds.bufferRange[0]));1092 var before = this.getRow(viewIndexFirst); 1174 1093 1175 1094 if (before) { … … 1196 1115 1197 1116 /** 1117 * Return the <TR> HtmlElement which represents a Grid row for the specified index. 1118 * The passed argument is assumed to be the absolute index and will get translated 1119 * to the index of the row that represents the data in the view. 1120 * 1121 * @param {Number} index The row index 1122 * 1123 * @return {null|HtmlElement} The <TR> element, or null if the row is not rendered 1124 * in the view. 1125 */ 1126 getRow : function(row) 1127 { 1128 if (row-this.rowIndex < 0) { 1129 return null; 1130 } 1131 1132 return this.getRows()[row-this.rowIndex]; 1133 }, 1134 1135 /** 1136 * Returns the grid's <TD> HtmlElement at the specified coordinates. 1137 * Returns null if the specified row is not currently rendered. 1138 * 1139 * @param {Number} row The row index in which to find the cell. 1140 * @param {Number} col The column index of the cell. 1141 * @return {HtmlElement} The <TD> at the specified coordinates. 1142 */ 1143 getCell : function(row, col) 1144 { 1145 var row = this.getRow(row); 1146 1147 return row 1148 ? row.getElementsByTagName('td')[col] 1149 : null; 1150 }, 1151 1152 /** 1198 1153 * Focuses the specified cell. 1199 1154 * @param {Number} row The row index … … 1244 1199 this.adjustScrollerPos((rowInd)*this.rowHeight); 1245 1200 } 1246 var rowInd = rowInd < 0 ? row : rowInd; 1247 var rowEl = this.getRow(row Ind), cellEl;1201 1202 var rowEl = this.getRow(row), cellEl; 1248 1203 1249 1204 if(!(hscroll === false && col === 0)){ … … 1251 1206 col++; 1252 1207 } 1253 cellEl = this.getCell(row -this.rowIndex, col);1208 cellEl = this.getCell(row, col); 1254 1209 } 1255 1210 … … 1265 1220 }, 1266 1221 1222 /** 1223 * Return strue if the passed record is in the visible rect of this view. 1224 * 1225 * @param {Ext.data.Record} record 1226 * 1227 * @return {Boolean} true if the record is rendered in the view, otherwise false. 1228 */ 1229 isRecordRendered : function(record) 1230 { 1231 var ind = this.ds.indexOf(record); 1232 1233 if (ind >= this.rowIndex && ind < this.rowIndex+this.visibleRows) { 1234 return true; 1235 } 1236 1237 return false; 1238 }, 1267 1239 1268 1240 /** … … 1327 1299 updateLiveRows: function(index, forceRepaint, forceReload) 1328 1300 { 1329 this.fireEvent('cursormove', this, index,1330 Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),1331 this.ds.totalLength);1332 1333 1301 var inRange = this.isInRange(index); 1334 1302 1335 if (this.isBuffering && this.isPrebuffering) {1336 if (inRange) {1337 this.replaceLiveRows(index);1338 } else {1339 this.showLoadMask(true);1340 }1341 }1342 1303 if (this.isBuffering) { 1304 if (this.isPrebuffering) { 1305 if (inRange) { 1306 this.replaceLiveRows(index); 1307 } else { 1308 this.showLoadMask(true); 1309 } 1310 } 1311 1312 this.fireEvent('cursormove', this, index, 1313 Math.min(this.ds.totalLength, 1314 this.visibleRows-this.rowClipped), 1315 this.ds.totalLength); 1316 1343 1317 this.requestQueue = index; 1344 1318 return; … … 1355 1329 // repaint the table's view 1356 1330 this.replaceLiveRows(index, forceRepaint); 1357 1331 // has to be called AFTER the rowIndex was recalculated 1332 this.fireEvent('cursormove', this, index, 1333 Math.min(this.ds.totalLength, 1334 this.visibleRows-this.rowClipped), 1335 this.ds.totalLength); 1358 1336 // lets decide if we can void this method or stay in here for 1359 1337 // requesting a buffer update -
trunk/src/JsonReader.js
r26 r31 7 7 * license. 8 8 * 9 * Commercial use is prohibited. Contact "Thorsten Suckow-Homberg" <ts@siteartwork.de>10 * if you need a commercial license.9 * Commercial use is prohibited. Visit <http://www.siteartwork.de/livegrid> 10 * if you need to obtain a commercial license. 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify it under … … 22 22 * this program. If not, see <http://www.gnu.org/licenses/gpl.html>. 23 23 * 24 * If you would like to support the development and support of the Ext.ux.Livegrid25 * component, you can make a donation: <http://www.siteartwork.de/livegrid>26 24 */ 27 25 -
trunk/src/resources/css/ext-ux-livegrid.css
r26 r31 1 . x-dd-drop-waiting {1 .ext-ux-livegrid-drop-waiting { 2 2 background-image:url(../images/loading.gif) !important; 3 3 } -
trunk/src/RowSelectionModel.js
r29 r31 7 7 * license. 8 8 * 9 * Commercial use is prohibited. Contact "Thorsten Suckow-Homberg" <ts@siteartwork.de>10 * if you need a commercial license.9 * Commercial use is prohibited. Visit <http://www.siteartwork.de/livegrid> 10 * if you need to obtain a commercial license. 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify it under … … 22 22 * this program. If not, see <http://www.gnu.org/licenses/gpl.html>. 23 23 * 24 * If you would like to support the development and support of the Ext.ux.Livegrid25 * component, you can make a donation: <http://www.siteartwork.de/livegrid>26 24 */ 27 25 … … 316 314 317 315 /** 316 * Deselects a record. 317 * The emthod assumes that the record is physically available, i.e. 318 * pendingSelections will not be taken into account 319 */ 320 deselectRecord : function(record, preventViewNotify) 321 { 322 if(this.locked) { 323 return; 324 } 325 326 var isSelected = this.selections.key(record.id); 327 328 if (!isSelected) { 329 return; 330 } 331 332 var store = this.grid.store; 333 var index = store.indexOfId(record.id); 334 335 if (index == -1) { 336 index = store.findInsertIndex(record); 337 if (index != Number.MIN_VALUE && index != Number.MAX_VALUE) { 338 index += store.bufferRange[0]; 339 } 340 } else { 341 // just to make sure, though this should not be 342 // set if the record was availablein the selections 343 delete this.pendingSelections[index]; 344 } 345 346 if (this.last == index) { 347 this.last = false; 348 } 349 350 if (this.lastActive == index) { 351 this.lastActive = false; 352 } 353 354 this.selections.remove(record); 355 356 if(!preventViewNotify){ 357 this.grid.getView().onRowDeselect(index); 358 } 359 360 this.fireEvent("rowdeselect", this, index, record); 361 this.fireEvent("selectionchange", this); 362 }, 363 364 /** 318 365 * Deselects a row. 319 366 * @param {Number} row The index of the row to deselect … … 378 425 this.grid.getView().onRowSelect(index); 379 426 } 427 380 428 this.fireEvent("rowselect", this, index, r); 381 429 this.fireEvent("selectionchange", this); -
trunk/src/Store.js
r26 r31 7 7 * license. 8 8 * 9 * Commercial use is prohibited. Contact "Thorsten Suckow-Homberg" <ts@siteartwork.de>10 * if you need a commercial license.9 * Commercial use is prohibited. Visit <http://www.siteartwork.de/livegrid> 10 * if you need to obtain a commercial license. 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify it under … … 22 22 * this program. If not, see <http://www.gnu.org/licenses/gpl.html>. 23 23 * 24 * If you would like to support the development and support of the Ext.ux.Livegrid25 * component, you can make a donation: <http://www.siteartwork.de/livegrid>26 24 */ 27 25 … … 570 568 //anything buffered yet? 571 569 if (this.bufferRange[0] == -1) { 572 return -1; 573 } 570 return undefined; 571 } 572 574 573 var modelIndex = index - this.bufferRange[0]; 575 574 return this.data.itemAt(modelIndex); -
trunk/src/Toolbar.js
r26 r31 7 7 * license. 8 8 * 9 * Commercial use is prohibited. Contact "Thorsten Suckow-Homberg" <ts@siteartwork.de>10 * if you need a commercial license.9 * Commercial use is prohibited. Visit <http://www.siteartwork.de/livegrid> 10 * if you need to obtain a commercial license. 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify it under … … 22 22 * this program. If not, see <http://www.gnu.org/licenses/gpl.html>. 23 23 * 24 * If you would like to support the development and support of the Ext.ux.Livegrid25 * component, you can make a donation: <http://www.siteartwork.de/livegrid>26 24 */ 27 25 … … 41 39 */ 42 40 Ext.ux.grid.livegrid.Toolbar = Ext.extend(Ext.Toolbar, { 41 42 /** 43 * @cfg {Ext.grid.GridPanel} grid 44 * The grid the toolbar is bound to. If ommited, use the cfg property "view" 45 */ 46 47 /** 48 * @cfg {Ext.grid.GridView} view The view the toolbar is bound to 49 * The grid the toolbar is bound to. If ommited, use the cfg property "grid" 50 */ 51 43 52 /** 44 53 * @cfg {Boolean} displayInfo … … 68 77 { 69 78 Ext.ux.grid.livegrid.Toolbar.superclass.initComponent.call(this); 70 this.bind(this.grid); 79 80 if (this.grid) { 81 this.bind(this.grid.getView()); 82 } else if (this.view) { 83 var me = this; 84 this.view.init = this.view.init.createSequence(function(){ 85 me.bind(this); 86 }, this.view); 87 } else { 88 throw("Ext.ux.grid.livegrid.Toolbar - cfg property view or grid is not available"); 89 } 71 90 }, 72 91 … … 84 103 85 104 /** 86 * Unbinds the toolbar from the specified {@link Ext.ux.grid.Livegrid} 87 * @param {@link Ext.ux.grid.Livegrid} view The view to unbind 88 */ 89 unbind : function(grid) 90 { 91 var st = grid.getStore(); 92 var vw = grid.view; 105 * Unbinds the toolbar. 106 * 107 * @param {Ext.grid.GridView|Ext.gid.GridPanel} view Either The view to unbind 108 * or the grid 109 */ 110 unbind : function(view) 111 { 112 var st; 113 var vw; 114 115 if (view instanceof Ext.grid.GridView) { 116 vw = view; 117 } else { 118 // assuming parameter is of type Ext.grid.GridPanel 119 vw = view.getView(); 120 } 121 122 st = view.ds; 93 123 94 124 st.un('loadexception', this.enableLoading, this); … … 101 131 vw.un('buffer', this.onBuffer, this); 102 132 vw.un('bufferfailure', this.enableLoading, this); 103 this.grid = undefined; 133 134 this.view = undefined; 104 135 }, 105 136 106 137 /** 107 138 * Binds the toolbar to the specified {@link Ext.ux.grid.Livegrid} 108 * @param {Ext.ux.grid.Livegrid} view The view to bind109 * /110 bind : function(grid)111 {112 var st = grid.getStore();113 var vw = grid.view;114 115 st.on('loadexception', this.enableLoading, this); 116 st.on(' beforeload', this.disableLoading,this);117 st.on(' load', this.enableLoading,this);118 vw.on('rowremoved', this.onRowRemoved,this);119 v w.on('rowsinserted', this.onRowsInserted,this);120 v w.on('beforebuffer', this.beforeBuffer,this);121 v w.on('cursormove', this.onCursorMove, this);122 v w.on('buffer', this.onBuffer,this);123 v w.on('bufferfailure', this.enableLoading,this);124 this.grid = grid;139 * 140 * @param {Ext.grird.GridView} view The view to bind 141 */ 142 bind : function(view) 143 { 144 this.view = view; 145 var st = view.ds; 146 147 st.on('loadexception', this.enableLoading, this); 148 st.on('beforeload', this.disableLoading, this); 149 st.on('load', this.enableLoading, this); 150 view.on('rowremoved', this.onRowRemoved, this); 151 view.on('rowsinserted', this.onRowsInserted, this); 152 view.on('beforebuffer', this.beforeBuffer, this); 153 view.on('cursormove', this.onCursorMove, this); 154 view.on('buffer', this.onBuffer, this); 155 view.on('bufferfailure', this.enableLoading, this); 125 156 }, 126 157 … … 174 205 switch (type) { 175 206 case 'refresh': 176 if (this. grid.view.reset(true)) {207 if (this.view.reset(true)) { 177 208 this.loading.disable(); 178 209 } else {
