detect if change have been submited

detect if change have been submited

bilusesbiluses Posts: 26Questions: 10Answers: 0

i'm using editor with server. How do i detect if a cell data changed and submited in order to, for example change that cell background?

thanks

This question has accepted answers - jump to:

Answers

  • Rob BrunRob Brun Posts: 56Questions: 2Answers: 14
    edited April 2017 Answer ✓

    Hi biluses, I use REST in my case, but the way that I was able to accomplish this is using the submit success event for editor.

     editor.on('submitSuccess', function(e, json, data) {
        var modifier = editor.modifier();
        var currentRow = table.row(modifier).node();
       
     if (data.SomeData === ''SomethingIAmTestingFor") {
            $('td', currentRow).eq(11).css('background-color', 'rgb(153, 255, 153)');
           } else {
                $('td', currentRow).eq(11).css('background-color', 'rgb(255, 128, 128)');
           }
    
    });
    
    

    If my condition is true it turns the 11 cell in the selected row to green, else if false it turns it red.

    Shay

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin
    Answer ✓

    Another option is the rowCallback option in DataTables which can be used to modify the data.

    Allan

This discussion has been closed.