Changeset 14868

Show
Ignore:
Timestamp:
08/15/08 19:31:23 (5 months ago)
Author:
toonetown
Message:

Fixes #7273 Fixes #7186 - restore scroll position when sorting or resizing columns !strict

Location:
dojox/trunk/grid
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dojox/trunk/grid/DataGrid.js

    r14856 r14868  
    155155                                this.setScrollTop(0); 
    156156                                this.postrender(); 
    157                         } 
    158                 } 
     157                        }else if(this._lastScrollTop){ 
     158                                this.setScrollTop(this._lastScrollTop); 
     159                        } 
     160                } 
     161                delete this._lastScrollTop; 
    159162                if(!this._isLoaded){ 
    160163                        this._isLoading = false; 
     
    171174        _onFetchError: function(err, req){ 
    172175                console.log(err); 
     176                delete this._lastScrollTop; 
    173177                if(!this._isLoaded){ 
    174178                        this._isLoading = false; 
     
    355359 
    356360        sort: function(){ 
     361                this._lastScrollTop = this.scrollTop; 
    357362                this._refresh(); 
    358363        }, 
  • dojox/trunk/grid/_Grid.js

    r14847 r14868  
    338338                        // summary: Creates a new virtual scroller 
    339339                        this.scroller = new dojox.grid._Scroller(); 
     340                        this.scroller.grid = this; 
    340341                        this.scroller._pageIdPrefix = this.id + '-'; 
    341342                        this.scroller.renderRow = dojo.hitch(this, "renderRow"); 
     
    728729                        } 
    729730                        //this.edit.saveState(inRowIndex); 
     731                        var lastScrollTop = this.scrollTop; 
    730732                        this.prerender(); 
    731733                        this.scroller.invalidateNodes(); 
    732                         this.setScrollTop(this.scrollTop); 
     734                        this.setScrollTop(lastScrollTop); 
    733735                        this.postrender(); 
    734736                        //this.edit.restoreState(inRowIndex); 
     
    829831 
    830832                setScrollTop: function(inTop){ 
    831                         this.scrollTop = this.views.setScrollTop(inTop); 
    832                         this.scroller.scroll(this.scrollTop); 
     833                        this.scroller.scroll(this.views.setScrollTop(inTop)); 
    833834                }, 
    834835 
  • dojox/trunk/grid/_Scroller.js

    r14847 r14868  
    336336                }, 
    337337                scroll: function(inTop){ 
     338                        this.grid.scrollTop = inTop; 
    338339                        if(this.colCount){ 
    339340                                this.startPacify();