Show
Ignore:
Timestamp:
07/09/09 14:55:22 (3 years ago)
Author:
tsuckow
Message:
  • enhancement: added Ext 3.0.0 compatibility
  • fixed: (GridView?.js) listener "onBeforeLoad()" now aborts any ongoing server request and properly resets properties "isBuffering" and "isPreBuffering"
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/Ext3.0/trunk/build/livegrid-all-debug.js

    r56 r57  
    437437                this.loadMask.msg, this.loadMask.msgCls 
    438438            ); 
    439             this._loadMaskAnchor._mask.addClass('ext-ux-livegrid'); 
    440             this._loadMaskAnchor._mask.setDisplayed(false); 
    441             this._loadMaskAnchor._maskMsg.setDisplayed(false); 
     439            var dom  = this._loadMaskAnchor.dom; 
     440            var data = Ext.Element.data; 
     441            data(dom, 'mask').addClass('ext-ux-livegrid'); 
     442            data(dom, 'mask').setDisplayed(false); 
     443            data(dom, 'maskMsg').setDisplayed(false); 
    442444        } 
    443445    }, 
     
    572574        var vw = csize.width; 
    573575 
    574         if(vw < 20 || csize.height < 20){ // display: none? 
     576        if(!g.hideHeaders && vw < 20 || csize.height < 20){ // display: none? 
    575577            return; 
    576578        } 
     
    657659        this.updateHeaderSortState(); 
    658660        this.afterMove(newIndex); 
     661        this.grid.fireEvent('columnmove', oldIndex, newIndex); 
    659662    }, 
    660663 
     
    949952    onBeforeLoad : function(store, options) 
    950953    { 
     954        var proxy = store.proxy; 
     955        if (proxy.activeRequest[Ext.data.Api.actions.read]) { 
     956            proxy.getConnection().abort(proxy.activeRequest[Ext.data.Api.actions.read]); 
     957        } 
     958 
     959        this.isBuffering    = false; 
     960        this.isPreBuffering = false; 
     961 
    951962        options.params = options.params || {}; 
    952963 
     
    11381149    processRows : function(startRow, skipStripe, paintSelections) 
    11391150    { 
    1140         skipStripe = skipStripe || !this.grid.stripeRows; 
    1141         // we will always process all rows in the view 
    1142         startRow = 0; 
    1143         var rows = this.getRows(); 
    1144         var cls = ' x-grid3-row-alt '; 
     1151        if(!this.ds || this.ds.getCount() < 1){ 
     1152            return; 
     1153        } 
     1154 
    11451155        var cursor = this.rowIndex; 
    1146  
    1147         var index      = 0; 
    1148         var selections = this.grid.selModel.selections; 
    1149         var ds         = this.ds; 
    1150         var row        = null; 
    1151         for(var i = startRow, len = rows.length; i < len; i++){ 
    1152             index = i+cursor; 
    1153             row   = rows[i]; 
    1154             // changed! 
    1155             row.rowIndex = index; 
     1156        skipStripe   = skipStripe || !this.grid.stripeRows; 
     1157        var rows     = this.getRows(); 
     1158        var index    = 0; 
     1159 
     1160        Ext.each(rows, function(row, idx) { 
     1161            row.rowIndex = index = cursor+idx; 
     1162            row.className = row.className.replace(this.rowClsRe, ' '); 
     1163            if (!skipStripe && (index + 1) % 2 === 0) { 
     1164                row.className += ' x-grid3-row-alt'; 
     1165            } 
    11561166 
    11571167            if (paintSelections !== false) { 
    11581168                if (this.grid.selModel.isSelected(this.ds.getAt(index)) === true) { 
    1159                     this.addRowClass(index, "x-grid3-row-selected"); 
     1169                    this.addRowClass(index, this.selectedRowClass); 
    11601170                } else { 
    1161                     this.removeRowClass(index, "x-grid3-row-selected"); 
     1171                    this.removeRowClass(index, this.selectedRowClass); 
    11621172                } 
    11631173                this.fly(row).removeClass("x-grid3-row-over"); 
    11641174            } 
    1165  
    1166             if(!skipStripe){ 
    1167                 var isAlt = ((index+1) % 2 == 0); 
    1168                 var hasAlt = (' '+row.className + ' ').indexOf(cls) != -1; 
    1169                 if(isAlt == hasAlt){ 
    1170                     continue; 
    1171                 } 
    1172                 if(isAlt){ 
    1173                     row.className += " x-grid3-row-alt"; 
    1174                 }else{ 
    1175                     row.className = row.className.replace("x-grid3-row-alt", ""); 
    1176                 } 
    1177             } 
     1175        }, this); 
     1176 
     1177        // add first/last-row classes 
     1178        if(cursor === 0){ 
     1179            Ext.fly(rows[0]).addClass(this.firstRowCls); 
     1180        } else if (cursor + rows.length == this.ds.totalLength) { 
     1181            Ext.fly(rows[rows.length - 1]).addClass(this.lastRowCls); 
    11781182        } 
    11791183    }, 
     
    15691573        } 
    15701574 
    1571         var mask    = this._loadMaskAnchor._mask; 
    1572         var maskMsg = this._loadMaskAnchor._maskMsg; 
     1575        var dom  = this._loadMaskAnchor.dom; 
     1576        var data = Ext.Element.data; 
     1577 
     1578        var mask    = data(dom, 'mask'); 
     1579        var maskMsg = data(dom, 'maskMsg'); 
    15731580 
    15741581        if (show) {