Change the color in a specific line

Change the color in a specific line

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

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

Thank you

Answers

  • kthorngrenkthorngren Posts: 20,148Questions: 26Answers: 4,736

    Take a look at createdRow. The examples should help.

    Kevin

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    Hi @thomas-99 ,

    Here's another example to look at too,

    Cheers,

    Colin

  • thomas-99thomas-99 Posts: 7Questions: 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: 15,118Questions: 1Answers: 2,583

    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

This discussion has been closed.