Delete an item from the Datatable

Delete an item from the Datatable

klermannklermann Posts: 277Questions: 67Answers: 1

Hi, Allan. When I try to delete an item from the Datatable, the delete button does not work on the first try, only after updating an item is that the item can be deleted, but when loading the table for the first time does not delete ...
user: admin@admin.com
pass:admin
ec2-34-224-65-226.compute-1.amazonaws.com:8080/financeiro/minhasContas/

This question has an accepted answers - jump to answer

Answers

  • ShayDeshShayDesh Posts: 6Questions: 1Answers: 2
    edited March 2018 Answer ✓

    Hi klermann, if you have any validation code in your preSubmit event make sure to check if(action !== 'remove')

    if you don't, your delete action will validate your form and return false because nothing is in the form on first load.

    This also explains why it works after an update, it's because the values from the update are still in your form and it passes your preSubmit event validations.

     editor.on('preSubmit', function(e, o, action) {
         if (action !== 'remove') {
             //yourvalidationcode
           }
    }
    

    At least that was what was happening to me when I was having the exact same issue you were.

    Shay

This discussion has been closed.