changing row colour after editor create/edit

changing row colour after editor create/edit

crush123crush123 Posts: 417Questions: 126Answers: 18
edited March 2015 in Editor

my datatable is rendered so that items on sale are shaded a different colour when the table is drawn

    "createdRow": function ( row, data, index ) {
       if ( data.refquality.QualityDescription == 'Sale' ) {
            $('td', row).addClass('highlight');
        }
    },

If I edit a row and set an item to be on sale, this newly edited row is not highlighted unless I refresh the page

This question has an accepted answers - jump to answer

Answers

  • crush123crush123 Posts: 417Questions: 126Answers: 18

    I have a solution which works.

    On closing the editor window, just do an ajax reload

    editor.on( 'close', function () {
          table.ajax.reload( null, false );
          } )
    
  • allanallan Posts: 61,765Questions: 1Answers: 10,111 Site admin
    Answer ✓

    The other option is to modify the row in the postEdit event.

    Unfortunately DataTables doesn't currently have a rowUpdated call back or event itself. That is something I will be adding in future (likely 1.11).

    Allan

This discussion has been closed.