Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35379

Halting remove event in TableTools

$
0
0

Hello I've downloaded the Editor trial.

I'm trying to prevent removal of a row if a certain condition is met. I tried to make a testcase on live.datatables.net but I couldn't get the Editor working.

Here is my code:

    editor.on( 'preSubmit', function ( e, data, action ) {
        var rowdata = rule_table.row( '.selected' ).data();
        if(action == "remove" && rowdata.default) {
            return false;
        }
        return true;
    } );

When I click on the remove button the normal remove confirm dialog pops up. After hitting the Delete button in that dialog, the dialog either stays put with no change or the activity-animation circle spins until I close the window. If I return true from this function the row is removed, as expected.

What is the proper way of doing this? I'd like an error dialog for feedback as well.

Thanks!


Viewing all articles
Browse latest Browse all 35379

Trending Articles