Change the color in a specific line

Change the color in a specific line

thomas-99thomas-99 Posts: 5Questions: 1Answers: 0

How can I change the background color in a row if a record has a specific status?

Thank you

Answers

  • kthorngrenkthorngren Posts: 3,299Questions: 19Answers: 740

    Take a look at createdRow. The examples should help.

    Kevin

  • colincolin Posts: 1,741Questions: 0Answers: 321

    Hi @thomas-99 ,

    Here's another example to look at too,

    Cheers,

    Colin

  • thomas-99thomas-99 Posts: 5Questions: 1Answers: 0

    Hi Colin,
    Thank you. When I want to display data, always comes: undefined

    $('#example').dataTable( {
    "createdRow": function( row, data, dataIndex ) {
    console.log(data[1]);
    }
    }
    } );

    if i just enter data, the whole array comes up

    DT_RowId: "row_12251"
    Name: "tester1"
    Land: "Deutschland"
    Firma: ""
    ​Name: "tester1"
    ....

    Why will not the array output?

    Ciao Thomas

  • colincolin Posts: 1,741Questions: 0Answers: 321

    Hi Thomas,

    It's most likely because you're using objects, the example on that page is used an array. Take a look at the example here, it's modified to use objects,

    Cheers,

    Colin

Sign In or Register to comment.