Changeset 35

Show
Ignore:
Timestamp:
11/01/08 23:19:34 (4 years ago)
Author:
tsuckowhomberg
google:author:
tsuckowhomberg
Message:
  • fixed: (EditorGridPanel?.js) call to "startEditing()" would throw error if the requested index in the view is not currently representing a record; overrode method for checking if record to edit is available
  • enhancement: (GridView?.js) adjusted behavior of "ensureVisible()" to scroll a requested cell horizontally into view
Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r33 r35  
    1 Version 0.3a3 (GPL) 
     1Version 0.3a4 (GPL) 
     21-November-2008 
     3 
     4 - fixed: (EditorGridPanel.js) call to "startEditing()" would throw error if the 
     5requested index in the view is not currently representing a record; overrode 
     6method for checking if record to edit is available 
     7 - enhancement: (GridView.js) adjusted behavior of "ensureVisible()" to scroll a 
     8requested cell horizontally into view 
     9 
     10Version 0.3a3 (GPL) 
    2111-November-2008 
    312 
  • trunk/src/EditorGridPanel.js

    r31 r35  
    5050 
    5151    /** 
     52     * Starts editing the specified for the specified row/column 
     53     * Will be cancelled if the requested row index to edit is not 
     54     * represented by data due to out of range regarding the view's 
     55     * store buffer. 
     56     * 
     57     * @param {Number} rowIndex 
     58     * @param {Number} colIndex 
     59     */ 
     60    startEditing : function(row, col) 
     61    { 
     62        this.stopEditing(); 
     63        if(this.colModel.isCellEditable(col, row)){ 
     64            this.view.ensureVisible(row, col, true); 
     65            if (!this.store.getAt(row)) { 
     66                return; 
     67            } 
     68        } 
     69 
     70        return Ext.ux.grid.livegrid.EditorGridPanel.superclass.startEditing.call(this, row, col); 
     71    }, 
     72 
     73    /** 
    5274     * Since we do not have multiple inheritance, we need to override the 
    5375     * same methods in this class we have overriden for 
  • trunk/src/GridView.js

    r31 r35  
    11581158    { 
    11591159        var xy = this.ensureVisible(row, col, hscroll); 
     1160 
    11601161        if (!xy) { 
    11611162                return; 
    11621163                } 
     1164 
    11631165                this.focusEl.setXY(xy); 
    11641166 
     
    12021204        var rowEl = this.getRow(row), cellEl; 
    12031205 
     1206        if(!rowEl){ 
     1207            return; 
     1208        } 
     1209 
    12041210        if(!(hscroll === false && col === 0)){ 
    12051211            while(this.cm.isHidden(col)){ 
     
    12091215        } 
    12101216 
    1211         if(!rowEl){ 
    1212             return; 
    1213         } 
    1214  
    12151217        var c = this.scroller.dom; 
     1218 
     1219        if(hscroll !== false){ 
     1220            var cleft = parseInt(cellEl.offsetLeft, 10); 
     1221            var cright = cleft + cellEl.offsetWidth; 
     1222 
     1223            var sleft = parseInt(c.scrollLeft, 10); 
     1224            var sright = sleft + c.clientWidth; 
     1225            if(cleft < sleft){ 
     1226                c.scrollLeft = cleft; 
     1227            }else if(cright > sright){ 
     1228                c.scrollLeft = cright-c.clientWidth; 
     1229            } 
     1230        } 
     1231 
    12161232 
    12171233        return cellEl ?