Results 1 to 3 of 3

Thread: Change row color on render function @ grid

  1. #1
    Ext User
    Join Date
    Jul 2009
    Posts
    7
    Vote Rating
    0
      0  

    Default Change row color on render function @ grid

    Hi , I'm looking for a solution to change the color of the row inside the render function, I already figured out how to change the cell color, but I'm not able to apply the same concept to the row.

    Thanks

  2. #2

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Here is what I got for sencha touch 2 :

    this renderer is for grid xtype column :

    renderer: function(value, record, rowIndex) {
    var index = Ext.getCmp('YourGridID').getStore().indexOf(record) + 1;
    var element = Ext.get('ext-gridrow-'+index);

    if(element){
    var myClassName = 'green'; //your css class here, I used green as background
    element.removeCls(myClassName);
    if (value !== null ) { //do your checking of the field value
    element.addCls(myClassName);
    }
    }
    return value;
    }


    Let me know if this helps / works for anyone else, good luck!

Posting Permissions

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