How can I sent a status message to client-side without being treated as an error?

How can I sent a status message to client-side without being treated as an error?

Tester2017Tester2017 Posts: 145Questions: 23Answers: 17

The case:

I'm allowing multiple-delete from client-side. But on the server, I check for foreign key constraints. Those rows which don't have constraints issues I delete, the others I don't delete. Everything is working. But in case some rows couldn't be deleted, I would like to inform the user about this.

And that's just where I have a lack of knowledge on how to achieve this goal.

I need to know if it is possible and if yes, a small hint. Then I will find it out myself further.

Thanks anyway.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin
    Answer ✓

    If you are using the PHP or .NET libraries there are cancellable events which can be used to prevent a row from being edited / deleted.

    To specifically tell the end user that this has happened while still allowing the other rows to be deleted you would need to listen for submitSuccess and check to see if there were any cancelled rows (cancelled).

    Allan

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17

    @allan,
    Thanks again! And every day I see more how nice DataTables is.

This discussion has been closed.