Results 1 to 5 of 5

Thread: [CLOSED][3.0rc2] Bug in GridView#doRender

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Dec 2008
    Location
    Mainz
    Posts
    241
    Vote Rating
    1
      0  

    Default [CLOSED] [3.0rc2] Bug in GridView#doRender

    PHP Code:
    If you do something like this in your render function:

    renderer: function(valuecellrecordrowIndexcolIndexstore)) {
        
    cell.aditionalClass = (this.isCellEditable(colIndexrowIndex) ? "x-form-text" '');
        return 
    value    

    all cells in the row followed by this column wil have the property aditionalClass.

    I do this cause I want to add a class to the div underneath the td in the grid.
    To do so i overwrite the cell template in this way
    PHP Code:
    this.viewConfig = {
                
    forceFittrue,
                
    templates: {
                    
    cell: new Ext.Template(
                        
    '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>',
                        
    '<div class="x-grid3-cell-inner x-grid3-col-{id} {aditionalClass}" unselectable="on" {attr}>{value}</div>',
                        
    '</td>'
                        
    )

                }
            }; 

    To fix this issue you just need to clear p in each loop.
    PHP Code:
     doRender : function(csrsdsstartRowcolCountstripe){
            var 
    ts this.templatesct ts.cellrt ts.rowlast colCount-1;
            var 
    tstyle 'width:'+this.getTotalWidth()+';';
            
    // buffers
            
    var buf = [], cbc= {}, rp = {tstyletstyle}, r;
            for(var 
    0len rs.lengthlenj++){
                
    rs[j]; cb = [];
                var 
    rowIndex = (j+startRow);
                for(var 
    0colCounti++){
    ///// ADDED //////
                    
    p={};
    //// ADDED END ////
                    
    cs[i];
                    
    p.id c.id;
                    
    p.css === 'x-grid3-cell-first ' : (== last 'x-grid3-cell-last ' '');
                    
    p.attr p.cellAttr "";
                    
    p.value c.renderer(r.data[c.name], prrowIndexids);
                    
    p.style c.style;
                    if(
    Ext.isEmpty(p.value)){
                        
    p.value "";
                    }
                    if(
    this.markDirty && r.dirty && typeof r.modified[c.name] !== 'undefined'){
                        
    p.css += ' x-grid3-dirty-cell';
                    }
                    
    cb[cb.length] = ct.apply(p);
                }
                var 
    alt = [];
                if(
    stripe && ((rowIndex+1) % === 0)){
                    
    alt[0] = "x-grid3-row-alt";
                }
                if(
    r.dirty){
                    
    alt[1] = " x-grid3-dirty-row";
                }
                
    rp.cols colCount;
                if(
    this.getRowClass){
                    
    alt[2] = this.getRowClass(rrowIndexrpds);
                }
                
    rp.alt alt.join(" ");
                
    rp.cells cb.join("");
                
    buf[buf.length] =  rt.apply(rp);
            }
            return 
    buf.join("");
        }, 

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    132
      0  

    Default

    You are making things far to difficult!

    Simply use:
    Code:
    renderer: function(value, cell, record, rowIndex, colIndex, store)) {
        cell.css = (this.isCellEditable(colIndex, rowIndex) ? "x-form-text" : '');
        return value
    }
    with a css rule:
    Code:
    .x-form-text .x-grid3-cell-inner {...}

  3. #3
    Sencha User
    Join Date
    Dec 2008
    Location
    Mainz
    Posts
    241
    Vote Rating
    1
      0  

    Red face

    Okay Makes Sense...

    Maybe you could help me with that... How will the rule
    .x-form-text .x-grid3-cell-inner {...}

    look like to have get styled like a textfield (same as simply x-form-text) ??

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    132
      0  

    Default

    In your original example the inner cell div was given a x-form-text class and your css rule was:
    Code:
    .x-form-text {...}
    In my example the outer cell td is given the x-form-text class. So your css rule needs to change to:
    Code:
    .x-form-text .x-grid3-cell-inner {...}

  5. #5
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Marking this bug as closed.
    Aaron Conran
    @aconran

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •