Update a value in a specific column of my row

Update a value in a specific column of my row

orionaseliteorionaselite Posts: 49Questions: 13Answers: 4

Using the example given here https://editor.datatables.net/examples/simple/inTableControls.html I was able to get edit and delete links in my table and when clicking on them i either get the editor model popup to edit data ot the delete dialog. All works well. This is done by the following code

/*start code for inline buttons*/
    // Edit record
    $('#users').on( 'click', 'a.editor_edit', function (e) {
        e.preventDefault();
 
        editor
            .title( 'Edit record' )
            .buttons( { "label": "Update", "fn": function () { editor.submit() } } )
            .edit( $(this).closest('tr') );
    } );
 
    // Delete a record
    $('#users').on( 'click', 'a.editor_remove', function (e) {
        e.preventDefault();
 
        editor
            .title( 'Edit record' )
            .message( "Are you sure you wish to delete this row?" )
            .buttons( { "label": "Delete", "fn": function () { editor.submit() } } )
            .remove( $(this).closest('tr') );
    } );
    /*end code for inline buttons*/

What I am trying to get done is instead of deleting the row on delete in need to update the value of a column named status in my db and set that value to 2 and then redraw the table. Any suggestions?

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.