Changeset 4

Show
Ignore:
Timestamp:
06/16/08 18:37:37 (4 years ago)
Author:
tsuckowhomberg
Message:
  • enhancement: BufferedGridStore? - added overrride of getAt() method to translate the passed argument to the appropriate index in the model; updated sources to take overriden method into account
Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r3 r4  
    1 2008-05-29 
    2 ========== 
    3 - fixed: wrong calculation in BufferedGridView.onLiveScroll (based on lastScrollPosition and actual  
     1 
     2Version 0.1 
     316-June-2008 
     4 
     5- enhancements: 
     6 - BufferedGridStore - added overrride of getAt() method to translate 
     7the passed argument to the appropriate index in the model; updated sources to take 
     8overriden method into account 
     9 - added cfg option "scrollDelay" in BufferedGridView for buffering calls to onLiveScroll  
     10when scroll-event gets fired (thanks to Rich Waters) 
     11 - BufferedStore: removed custom applySort() implementation due to changes in findInsertIndex 
     12 - BufferedStore: changed findInsertIndex to use parent implementation first, then check  
     13return value and adjust the index if needed 
     14 - BufferedStore/BufferedGridView: moved bufferRange-member to BufferedStore 
     15 - BufferedStore: optimized insert() method in BufferedStore 
     16 - allowed to add records at position "0" in grid (existing records get shifted down) 
     17  
     18- fixes: 
     19 - wrong calculation in BufferedGridView.onLiveScroll (based on lastScrollPosition and actual  
    420scrollPosition) caused the view sometimes to not re-render some rows 
    5 - fixed: provided bug fix for "ensureVisible: returned x-coordinate does not take the x-position 
     21 - provided bug fix for "ensureVisible: returned x-coordinate does not take the x-position 
    622of the gridpanel into account" (see http://extjs.com/forum/showthread.php?p=175331#post175331) 
    7 - enhancement: added cfg option "scrollDelay" in BufferedGridView for buffering calls to onLiveScroll  
    8 when scroll-event gets fired (thanks to Rich Waters) 
    9  
    10  
    11 2008-05-28 
    12 ========== 
    13 - fixed: wrong calculation of last displayable row after removing a row caused selection-model 
     23 - wrong calculation of last displayable row after removing a row caused selection-model 
    1424to get out of synch with the store's data 
    15  
    16 2008-05-17 
    17 ========== 
    18 - enhancement: BufferedStore: removed custom applySort() implementation due to changes in findInsertIndex 
    19 - enhancement: BufferedStore: changed findInsertIndex to use parent implementation first, then check  
    20  return value and adjust the index if needed 
    21 - enhancement: BufferedStore/BufferedGridView: moved bufferRange-member to BufferedStore 
    22 - enhancement: BufferedStore: optimized insert() method in BufferedStore 
    23 - fixed: when adding a record to the store on the fly, the ensureVisible-method 
     25 - when adding a record to the store on the fly, the ensureVisible-method 
    2426would not work always corect afterwards 
    25 - fixed: when adding records, a previously made selection would block selecting the 
     27 - when adding records, a previously made selection would block selecting the 
    2628newly added record 
    27  - enhancement: allowed to add records at position "0" in grid (existing records get shifted down) 
    28 - fixed: skipped request for updateLiveRows in Ext.ux.grid.BufferedGridView.adjustVisibleRows 
     29 - skipped request for updateLiveRows in Ext.ux.grid.BufferedGridView.adjustVisibleRows 
    2930when number of total records in store is less than the number of visible rows 
    30 - fixed: request for buffering data in Ext.ux.grid.BufferedGridView.updateLiveRows() did 
     31 - request for buffering data in Ext.ux.grid.BufferedGridView.updateLiveRows() did 
    3132not apply the property "lastOptions.params" to the params sent with the buffer-request 
    32  
    33  
  • trunk/src/BufferedGridView.js

    r3 r4  
    615615             
    616616            var cInd = viewIndex-this.rowIndex; 
    617             var rec  = this.ds.getAt(lastPossibleRIndex); 
     617            var rec  = this.ds.getAt(this.rowIndex+this.visibleRows-1); 
    618618             
    619619            // did we reach the end of the buffer range? 
     
    10071007                if (this.grid.selModel.bufferedSelections[index] === true) { 
    10081008                    this.addRowClass(i, "x-grid3-row-selected"); 
    1009                     selections.add(ds.getAt(index-this.ds.bufferRange[0]));      
     1009                    selections.add(ds.getAt(index));      
    10101010                } 
    10111011                this.fly(row).removeClass("x-grid3-row-over"); 
  • trunk/src/BufferedRowSelectionModel.js

    r2 r4  
    286286            this.lastActive = false; 
    287287        } 
    288         var r = this.grid.store.getAt(index-this.grid.getStore().bufferRange[0]); 
     288        var r = this.grid.store.getAt(index); 
    289289         
    290290        delete this.pendingSelections[index]; 
     
    312312        if(this.last === index || this.locked || index < 0) return;// || index >= this.grid.store.getCount())) return; 
    313313         
    314         //var r = this.grid.store.getAt(index); 
    315         var r = this.grid.store.getAt(index-this.grid.getStore().bufferRange[0]); 
     314         
     315        var r = this.grid.store.getAt(index); 
    316316        
    317317        if(this.fireEvent("beforerowselect", this, index, keepExisting, r) !== false){ 
     
    341341    clearPendingSelection : function(index) 
    342342    { 
    343         var r = this.grid.store.getAt(index-this.grid.getStore().bufferRange[0]);    
     343        var r = this.grid.store.getAt(index);    
    344344        if (!r) { 
    345345            return; 
  • trunk/src/BufferedStore.js

    r2 r4  
    443443        Ext.ux.grid.BufferedStore.superclass.loadRecords.call(this, o, options, success);     
    444444    },     
     445     
     446    /** 
     447     * Get the Record at the specified index. 
     448     * The function will take the bufferRange into account and translate the passed argument 
     449     * to the index of the record in the current buffer. 
     450     * 
     451     * @param {Number} index The index of the Record to find. 
     452     * @return {Ext.data.Record} The Record at the passed index. Returns undefined if not found. 
     453     */ 
     454    getAt : function(index) 
     455    { 
     456        var modelIndex = index - this.bufferRange[0]; 
     457        return this.data.itemAt(modelIndex); 
     458    },     
     459     
    445460//--------------------------------------EMPTY----------------------------------- 
    446461    // no interface concept, so simply overwrite and leave them empty as for now