Changeset 13860

Show
Ignore:
Timestamp:
06/02/08 12:51:20 (6 months ago)
Author:
BryanForbes
Message:

refs #6546 !strict

  • Switched order of arguments to get and format so plain _Grid's don't have a null first argument.
Location:
dojox/trunk/grid
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • dojox/trunk/grid/cells/_base.js

    r13849 r13860  
    3939 
    4040                // data source 
    41                 format: function(inItem, inRowIndex){ 
     41                format: function(inRowIndex, inItem){ 
    4242                        // summary: 
    4343                        //      provides the html for a given grid cell. 
     
    4545                        // grid row index 
    4646                        // returns: html for a given grid cell 
    47                         var f, i=this.grid.edit.info, d=this.get ? this.get(inItem, inRowIndex) : (this.value || this.defaultValue); 
     47                        var f, i=this.grid.edit.info, d=this.get ? this.get(inRowIndex, inItem) : (this.value || this.defaultValue); 
    4848                        if(this.editable && (this.alwaysEditing || (i.rowIndex==inRowIndex && i.cell==this))){ 
    4949                                return this.formatEditing(d, inRowIndex); 
     
    287287                postscript: function(){ 
    288288                        this.editable = false; 
    289                         this.get = function(inItem, inRowIndex){ 
     289                        this.get = function(inRowIndex){ 
    290290                                return inRowIndex + 1; 
    291291                        }; 
  • dojox/trunk/grid/DataGrid.js

    r13855 r13860  
    3535        }, 
    3636 
    37         get: function(inItem, inRowIndex){ 
     37        get: function(inRowIndex, inItem){ 
    3838                return (!inItem ? this.defaultValue : (!this.field ? this.value : this.grid.store.getValue(inItem, this.field))); 
    3939        }, 
  • dojox/trunk/grid/tests/test_change_structure.html

    r13818 r13860  
    3333 
    3434                // get can return data for a cell of the grid 
    35                 function get(inItem, inRowIndex) { 
     35                function get(inRowIndex) { 
    3636                        return [this.index, inRowIndex].join(', '); 
    3737                } 
  • dojox/trunk/grid/tests/test_events.html

    r13818 r13860  
    7171                ];       
    7272                 
    73                 getEventName = function(inItem, inRowIndex) { 
     73                getEventName = function(inRowIndex) { 
    7474                        return eventRows[inRowIndex].name; 
    7575                }; 
    7676                 
    77                 getEventData = function(inItem, inRowIndex) { 
     77                getEventData = function(inRowIndex) { 
    7878                        var d = eventRows[inRowIndex].data; 
    7979                        var r = []; 
  • dojox/trunk/grid/tests/test_expand.html

    r13832 r13860  
    5555                 
    5656                // get can return data for each cell of the grid 
    57                 function get(inItem, inRowIndex) { 
     57                function get(inRowIndex) { 
    5858                        return [this.index, inRowIndex].join(', '); 
    5959                } 
    6060                 
    61                 function getDetail(inItem, inRowIndex) { 
     61                function getDetail(inRowIndex) { 
    6262                        if (this.grid.expandedRows[inRowIndex]) { 
    6363                                var n = (inRowIndex % 2); 
     
    7777                } 
    7878                 
    79                 function getCheck(inItem, inRowIndex) { 
     79                function getCheck(inRowIndex) { 
    8080                        if (!this.grid.expandedRows) 
    8181                                this.grid.expandedRows = [ ]; 
  • dojox/trunk/grid/tests/test_sizing.html

    r13832 r13860  
    5050                 
    5151                // get can return data for each cell of the grid 
    52                 function get(inItem, inRowIndex) { 
     52                function get(inRowIndex) { 
    5353                        return [this.index, inRowIndex].join(', '); 
    5454                } 
  • dojox/trunk/grid/tests/test_sizing_ResizeHandle.html

    r13832 r13860  
    5454                 
    5555                // get can return data for each cell of the grid 
    56                 function get(inItem, inRowIndex) { 
     56                function get(inRowIndex) { 
    5757                        return [this.index, inRowIndex].join(', '); 
    5858                } 
  • dojox/trunk/grid/tests/test_subgrid.html

    r13832 r13860  
    4343                ];                
    4444 
    45                 getDetailData = function(inItem, inRowIndex) { 
     45                getDetailData = function(inRowIndex) { 
    4646                        var row = data[this.grid.dataRow % data.length]; 
    4747                        switch (this.index) { 
     
    6363                }                 
    6464                 
    65                 getName = function(inItem, inRowIndex) { 
     65                getName = function(inRowIndex) { 
    6666                        var row = data[inRowIndex % data.length]; 
    6767                        return row[2]; 
     
    8484                 
    8585                // html for the +/- cell 
    86                 function getCheck(inItem, inRowIndex) {  
     86                function getCheck(inRowIndex) {  
    8787                        var image = (detailRows[inRowIndex] ? 'open.gif' : 'closed.gif'); 
    8888                        var show = (detailRows[inRowIndex] ? 'false' : 'true') 
     
    9191                 
    9292                // provide html for the Detail cell in the master grid           
    93                 function getDetail(inItem, inRowIndex) { 
     93                function getDetail(inRowIndex) { 
    9494                        var cell = this; 
    9595                        // we can affect styles and content here, but we have to wait to access actual nodes 
  • dojox/trunk/grid/tests/yahooSearch.js

    r13846 r13860  
    2828}; 
    2929 
    30 var getLink = function(inItem, inRowIndex){ 
     30var getLink = function(inRowIndex, inItem){ 
    3131        if(!inItem){ return ' '; } 
    3232        var text = getCellData(inItem, 'Title'); 
     
    4747}; 
    4848 
    49 var getImage = function(inItem, inRowIndex){ 
     49var getImage = function(inRowIndex, inItem){ 
    5050        if(!inItem){ return ' '; } 
    5151        var thumb = getCellData(inItem, "Thumbnail"); 
     
    6060}; 
    6161 
    62 var getDimensions = function(inItem, inRowIndex){ 
     62var getDimensions = function(inRowIndex, inItem){ 
    6363        if(!inItem){ return ' '; } 
    6464        var w = getCellData(inItem, "Width"); 
  • dojox/trunk/grid/_View.js

    r13849 r13860  
    339339                                        m = cell.markup, cc = cell.customClasses = [], cs = cell.customStyles = []; 
    340340                                        // content (format can fill in cc and cs as side-effects) 
    341                                         m[5] = cell.format(item, inRowIndex); 
     341                                        m[5] = cell.format(inRowIndex, item); 
    342342                                        // classes 
    343343                                        m[1] = cc.join(' ');