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: 21,300Questions: 26Answers: 4,945

    Take a look at createdRow. The examples should help.

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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,240Questions: 1Answers: 2,599

    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.