Changeset 36

Show
Ignore:
Timestamp:
11/23/08 19:59:51 (3 years ago)
Author:
tsuckowhomberg
google:author:
tsuckowhomberg
Message:
  • enhancement: added build tools for creating minified deployable versions of Ext.ux.Livegrid-scripts
  • enhancement: (GridView?.js) the rowIndex argument of the column's renderer will now pass the value of the index of the row as available in the view, i.e. as defined in the row's rowIndex property, which adds support for Ext.grid.RowNumberer?
  • fixed: (GridView?.js) fixed a bug where "getPredictedBufferIndex()" would not compute the next rowIndex for a request properly, leading to an endless loop
  • enhancement: (GridView?.js, RowSelectionModel?.js) removed override of "onRefresh()" to keep selections after a refresh or sort occured, if, and only if those records are

returned by the response; removed custom call to selection model's "clearSelections()" in the GridView?'s "reset()" method

  • enhancement: intercepted "autoLoad" property of Ext.ux.grid.livegrid.Store to make sure the store gets only loaded if the view has been rendered, if the store's autoLoad property was set to "true"
Location:
trunk
Files:
15 added
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r35 r36  
    1 Version 0.3a4 (GPL) 
     1Version 0.3RC1 (GPL) 
     223-November-2008 
     3 
     4 - enhancement: added build tools for creating minified deployable versions of 
     5Ext.ux.Livegrid-scripts 
     6 - enhancement: (GridView.js) the rowIndex argument of the column's renderer will 
     7now pass the value of the index of the row as available in the view, i.e. as defined 
     8in the row's rowIndex property, which adds support for Ext.grid.RowNumberer 
     9 - fixed: (GridView.js) fixed a bug where "getPredictedBufferIndex()" would not 
     10compute the next rowIndex for a request properly, leading to an endless loop 
     11 - enhancement: (GridView.js, RowSelectionModel.js) removed override of "onRefresh()" 
     12to keep selections after a refresh or sort occured, if, and only if those records are 
     13returned by the response; removed custom call to selection model's "clearSelections()" 
     14in the GridView's "reset()" method 
     15 - enhancement: intercepted "autoLoad" property of Ext.ux.grid.livegrid.Store to make 
     16sure the store gets only loaded if the view has been rendered, if the store's autoLoad 
     17property was set to "true" 
     18 
     19 
     20Version 0.3a4 (GPL) 
    2211-November-2008 
    322 
  • trunk/README

    r31 r36  
     1Note: 
     2----- 
     3Including the file "ext-ux-livegrid.css" is mandatory, otherwise the view will 
     4not be rendered properly. 
     5 
    16Author: 
    27------- 
     
    611------------- 
    712http://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/EditorGridPanel.js

    r35 r36  
    7171    }, 
    7272 
    73     /** 
    74      * Since we do not have multiple inheritance, we need to override the 
    75      * same methods in this class we have overriden for 
    76      * Ext.ux.grid.livegrid.GridPanel 
    77      * 
    78      */ 
     73// Since we do not have multiple inheritance, we need to override the 
     74// same methods in this class we have overriden for 
     75// Ext.ux.grid.livegrid.GridPanel 
    7976    walkCells : function(row, col, step, fn, scope) 
    8077    { 
    8178        return Ext.ux.grid.livegrid.GridPanel.prototype.walkCells.call(this, row, col, step, fn, scope); 
     79    }, 
     80 
     81    onRender : function(ct, position) 
     82    { 
     83        return Ext.ux.grid.livegrid.GridPanel.prototype.onRender.call(this, ct, position); 
    8284    } 
    8385 
  • trunk/src/GridPanel.js

    r31 r36  
    3737 
    3838    /** 
     39     * Overriden to make sure the attached store loads only when the 
     40     * grid has been fully rendered if, and only if the store's 
     41     * "autoLoad" property is set to true. 
     42     * 
     43     */ 
     44    onRender : function(ct, position) 
     45    { 
     46        Ext.ux.grid.livegrid.GridPanel.superclass.onRender.call(this, ct, position); 
     47 
     48        var ds = this.getStore(); 
     49 
     50        if (ds._autoLoad === true) { 
     51            delete ds._autoLoad; 
     52            ds.load(); 
     53        } 
     54    }, 
     55 
     56    /** 
    3957     * Overriden since the original implementation checks for 
    4058     * getCount() of the store, not getTotalCount(). 
  • trunk/src/GridView.js

    r35 r36  
    137137    ); 
    138138 
    139     Ext.ux.grid.livegrid.GridView.superclass.constructor.call(this); 
     139    // shorthands for often used parent classes 
     140    this._gridViewSuperclass = Ext.ux.grid.livegrid.GridView.superclass; 
     141 
     142    this._gridViewSuperclass.constructor.call(this); 
     143 
     144 
    140145}; 
    141146 
     
    276281        if (forceReload === false) { 
    277282            this.ds.modified = []; 
    278             this.grid.selModel.clearSelections(true); 
     283            //this.grid.selModel.clearSelections(true); 
    279284            this.rowIndex      = 0; 
    280285            this.lastScrollPos = 0; 
     
    325330        g.enableDrag     = false; 
    326331 
    327         Ext.ux.grid.livegrid.GridView.superclass.renderUI.call(this); 
     332        this._gridViewSuperclass.renderUI.call(this); 
    328333 
    329334        var g = this.grid; 
     
    360365    init: function(grid) 
    361366    { 
    362         Ext.ux.grid.livegrid.GridView.superclass.init.call(this, grid); 
     367        this._gridViewSuperclass.init.call(this, grid); 
    363368 
    364369        grid.on('expand', this._onExpand, this); 
     
    376381        } 
    377382 
    378         Ext.ux.grid.livegrid.GridView.superclass.initData.call(this, ds, cm); 
     383        this._gridViewSuperclass.initData.call(this, ds, cm); 
    379384    }, 
    380385 
     
    389394        var markup = this.renderRows(0, this.visibleRows-1); 
    390395        return this.templates.body.apply({rows: markup}); 
     396    }, 
     397 
     398    /** 
     399     * Overriden so the renderer of the specific cells gets the index of the 
     400     * row as available in the view passed (row's rowIndex property)- 
     401     * 
     402     */ 
     403    doRender : function(cs, rs, ds, startRow, colCount, stripe) 
     404    { 
     405        return this._gridViewSuperclass.doRender.call( 
     406            this, cs, rs, ds, startRow + this.ds.bufferRange[0], colCount, stripe 
     407        ); 
     408 
    391409    }, 
    392410 
     
    12721290    { 
    12731291        var lastRowIndex = Math.min(this.ds.totalLength-1, 
    1274                                     rowIndex + this.visibleRows); 
     1292                                    rowIndex + (this.visibleRows-1)); 
    12751293 
    12761294        return (rowIndex     >= this.ds.bufferRange[0]) && 
     
    12881306    { 
    12891307        if (!inRange) { 
    1290             var dNear = 2*this.nearLimit; 
    1291             return Math.max(0, index-((dNear >= this.ds.bufferSize ? this.nearLimit : dNear))); 
     1308            if (index + this.ds.bufferSize >= this.ds.totalLength) { 
     1309                return this.ds.totalLength - this.ds.bufferSize; 
     1310            } 
     1311            // we need at last to render the index + the visible Rows 
     1312            return Math.max(0, (index + this.visibleRows) - Math.round(this.ds.bufferSize/2)); 
    12921313        } 
    12931314        if (!down) { 
  • trunk/src/RowSelectionModel.js

    r31 r36  
    6666        this.grid.store.on('selectionsload', this.onSelectionsLoad, this); 
    6767    }, 
    68  
    69  
    70  
    71     // private 
    72     onRefresh : function() 
    73     { 
    74         this.clearSelections(true); 
    75     }, 
    76  
    77  
    7868 
    7969    /** 
  • trunk/src/Store.js

    r31 r36  
    9898    // remoteSort will always be set to true. 
    9999    config.remoteSort = true; 
     100 
     101    // we will intercept the autoLoad property and set it to false so we do not 
     102    // load any contents of the store before the View has not fully initialized 
     103    // itself. if autoLoad was set to true, the Ext.ux.grid.livegrid.GridPanel 
     104    // will take care of loading the store once it has been rendered 
     105    this._autoLoad  = config.autoLoad ? true : false; 
     106    config.autoLoad = false; 
    100107 
    101108    this.addEvents(