When update Row

When update Row

Leoap5Leoap5 Posts: 2Questions: 0Answers: 0

Hi,

I have a probleme with Datatable

Live example : http://live.datatables.net/fobecomo/1/edit?html,css,js,output

I use fnCreatedRow to change column color when loading data ( if column is > 25 then change color to green )

but the probleme is when i edit column with editor if it < 25 it stay green color

how can i change color when updating column ????

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Hi,

    You would need to use fnRowCallback (or rowCallback in the 1.10 syntax).

    The problem with fnCreatedRow (createdRow) is that is only triggers when the row is created - not when it is updated. I need to add suitable events for that!

    Allan

  • Leoap5Leoap5 Posts: 2Questions: 0Answers: 0

    Thank you for your reponse

    i figure it out like this

    $('#example tbody').on('click', 'tr', function () {
    updatedTD = $('td', this).eq(8);
    } );

    editor.on( 'onEdit', function ( e, json, data ) {
    var _class = (data[8] > 25) ? ''green': ' ';
    updatedTD.removeClass();
    updatedTD.addClass(_class);
    });

    i posted the code for other person that have the same probleme

    Best regard,

This discussion has been closed.