[CLOSED] Changing datarow background color after switching from v1.x to v2.x

  1. #1

    [CLOSED] Changing datarow background color after switching from v1.x to v2.x

    Hi

    With v1.x I was changing the color of my datatable rows according to some content of specific records via javascript on <PrepareToolbar Fn="prepare" /> of a command column. However with v2.x this code doesn't work anymore. I haven't found out yet what changed.

    Any ideas?

    v1.x javascript code not working anymore with 2.x:
    grid.getView().getRow(rowIndex).style.backgroundColor = 'Yellow';
    Thank you!
    Last edited by Daniil; Jan 24, 2014 at 3:28 PM. Reason: [CLOSED]
  2. #2
    Hi @tMp,

    A direct substitution could be:
    var row = Ext.fly(App.GridPanel1.getView().getNode(0));
    
    row.select("td").setStyle({
        "background-color": "yellow";
    })
    Though, if possible, I would recommend to use a GetRowClass to apply styles for rows.
    https://examples2.ext.net/#/GridPane...rking_Records/
  3. #3
    @Daniil

    I have now idea anymore how I got to use it that way. Switched asap to getRowClass and now it is working perfectly.

    Thank you and have a great weekend!
    Last edited by tMp; Jan 24, 2014 at 5:20 PM.
  4. #4
    Thank you! Have a nice weekend too!

Similar Threads

  1. [CLOSED] Changing Chart Background Color
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 22, 2013, 10:55 AM
  2. Replies: 7
    Last Post: Jul 11, 2012, 1:12 PM
  3. [CLOSED] Changing the background color of htmleditor
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 18, 2012, 5:41 PM
  4. Changing TreePanel background color
    By wexman in forum 1.x Help
    Replies: 3
    Last Post: Apr 06, 2011, 2:35 PM
  5. [CLOSED] Changing background color of TabPanel on the fly
    By rmelancon in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 07, 2010, 12:23 PM

Posting Permissions