Chaining a delete after submitSuccess

Chaining a delete after submitSuccess

schwaluckschwaluck Posts: 44Questions: 15Answers: 0

Hi all,

I have the following situation:
After an entry in my table is edited and the changes are submitted successfully to the server, the edited entries shall be deleteed from the table (in the backend, not just in the frontend). I know that editor makes chaning super easy so I tried to chain the remove() function into the submitSuccess event for editor.

However, I struggle to give the remove() function the right index in order to get the delete working. Can anyone help me out with this?

Here's the code I have so far:

editor.on( 'submitSuccess', function ( e, json, data ) {
    editor
        .title( 'Delete row' )
        .buttons( 'Confirm delete' )
        .message( 'Are you sure you want to remove this row?' )
        .remove( table.rows( {selected: true } ).indexes() );
    } );

The remove dialog will open but when I try to hit the delete button, I get the following error message: unknown index:data.

Thanks for your help!

Answers

  • schwaluckschwaluck Posts: 44Questions: 15Answers: 0

    Already resolved, since I did it in the php-part of my script.

Sign In or Register to comment.