Results 1 to 3 of 3

Thread: Method signature of column renderers

  1. #1

    Default Method signature of column renderers

    Hi,
    I am new to extjs and needed to know if the column renderer functions have any signature pattern. i was not able to find any relevant solution by going through the api doc.
    eg
    for one column its:

    {
    header:'cost',
    dataIndex:'cost',
    renderer: function(v,params,record){
    return Ext.util.Format.usMoney(record.data.estimate+record.data.rate);
    }
    }



    and for the other its

    {
    header:'estimate',
    dataIndex:'estimate',
    renderer: function(v){
    return v + 'hours'
    },
    editor: new Ext.form.NumberField({
    allowBlank:false,
    allowNegative:false
    })
    }

  2. #2
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    707

    Default

    Looking at the ColumnModel API I read this:

    See Ext.grid.Column for additional configuration options for each column.
    Under the Column config options, see renderer and it shows an example with params. The example lists params. It also points to setRenderer to see param definition and that looks like this:

    Code:
    The render function is called with the following parameters:
    
        * value : Object
    
          The data value for the cell.
        * metadata : Object
    
          An object in which you may set the following attributes:
              o css : String
    
                A CSS class name to add to the cell's TD element.
              o attr : String
    
                An HTML attribute definition string to apply to the data container element within the table cell (e.g. 'style="color:red;"').
    
        * record : Ext.data.record
    
          The Ext.data.Record from which the data was extracted.
        * rowIndex : Number
    
          Row index
        * colIndex : Number
    
          Column index
        * store : Ext.data.Store
    
        The Ext.data.Store object from which the Record was extracted.

  3. #3

    Default

    Thx carol

Posting Permissions

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