Changeset 15

Show
Ignore:
Timestamp:
08/30/08 02:36:55 (4 years ago)
Author:
tsuckowhomberg
Message:
  • fixed: last row would not always be rendered proper if the end of records is reached and the panel would be resized so that more records are displayable
  • enhancement: improved calculating the height of the buffer inset in both performance and functionality
  • enhancement: component now working with Safari 3.1 under windows XP
Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r13 r15  
    1 Version 0.2rc2 
     1Version 0.2rc3 
     230-August-2008 
     3 
     4- fixes; 
     5 - BufferedGridView.js: last row would not always be rendered proper if the end of 
     6records is reached and the panel would be resized so that more records are displayable 
     7- enhancements: 
     8 - BufferedGridView.js: improved calculating the height of the buffer inset in both 
     9performance and functionality. Component now working with Safari 3.1 under Windows XP 
     10 
     11Version 0.2rc2 
    21229-August-2008 
    313 
  • trunk/src/BufferedGridView.js

    r13 r15  
    14831483        // adjust the height of the scrollbar 
    14841484 
    1485         var contHeight = this.liveScroller.dom.parentNode.offsetHeight + 
     1485        var liveScrollerDom = this.liveScroller.dom; 
     1486 
     1487        var contHeight = liveScrollerDom.parentNode.offsetHeight + 
    14861488                         (Ext.isGecko 
    14871489                         ? ((ds.totalLength > 0 && scrollbar) 
     
    14911493                            ? 0 : this.horizontalScrollOffset))) 
    14921494 
    1493         this.liveScroller.dom.style.height = contHeight+"px"; 
     1495        liveScrollerDom.style.height = contHeight+"px"; 
    14941496 
    14951497        if (this.rowHeight == -1) { 
    14961498            return; 
    14971499        } 
    1498  
    1499         // calculate the spill of the inner layer. 
    1500         // spillHeight will contain the number of pixels 
    1501         // the inner layer exceeds the scrollbar 
    1502         var spillHeight = ((this.rowHeight*ds.totalLength)+this.hdHeight)-contHeight; 
    15031500 
    15041501        // hidden rows is the number of rows which cannot be 
    15051502        // displayed and for which a scrollbar needs to be 
    1506         // rendered. This does alsso take clipped rows into account 
    1507         var hiddenRows = 0; 
    1508         if (spillHeight > 0) { 
    1509             hiddenRows = Math.ceil(spillHeight/this.rowHeight); 
    1510         } 
    1511  
    1512         this.liveScrollerInset.style.height = contHeight+(hiddenRows*this.rowHeight)+"px"; 
     1503        // rendered. This does also take clipped rows into account 
     1504        var hiddenRows = (ds.totalLength == this.visibleRows-this.rowClipped) 
     1505                       ? 0 
     1506                       : Math.max(0, ds.totalLength-(this.visibleRows-this.rowClipped)); 
     1507 
     1508        this.liveScrollerInset.style.height = (hiddenRows == 0 ? 0 : contHeight+(hiddenRows*this.rowHeight))+"px"; 
    15131509    }, 
    15141510 
     
    15521548 
    15531549        this.rowClipped = 0; 
    1554         if (this.rowHeight / 3 < (vh - (visibleRows*this.rowHeight))) { 
     1550        // only compute the clipped row if the total length of records 
     1551        // exceeds the number of visible rows displayable 
     1552        if (totalLength > visibleRows && this.rowHeight / 3 < (vh - (visibleRows*this.rowHeight))) { 
    15551553            visibleRows = Math.min(visibleRows+1, totalLength); 
    15561554            this.rowClipped = 1; 
    15571555        } 
    15581556 
    1559         // adjusted condition to force rerendering of scrollbar if the 
    1560         // toalLength is less than visibleRows 
    1561         if (this.visibleRows == visibleRows) { 
     1557        if (this.visibleRows == visibleRows - this.rowsClipped) { 
    15621558            return; 
    15631559        } 
     
    15691565            return; 
    15701566        } 
    1571         if (this.rowIndex + visibleRows > totalLength) { 
    1572             this.rowIndex     = Math.max(0, totalLength-visibleRows); 
     1567        // when re-rendering, doe not take the clipped row into account 
     1568        if (this.rowIndex + (visibleRows-this.rowClipped) > totalLength) { 
     1569            this.rowIndex     = Math.max(0, totalLength-(visibleRows-this.rowClipped)); 
    15731570            this.lastRowIndex = this.rowIndex; 
    15741571        }