Cancellable php events

Cancellable php events

gixxy22gixxy22 Posts: 15Questions: 7Answers: 1

I would like to perform some extra checks/validation on pre-events using the PHP libraries, i can see here: https://editor.datatables.net/manual/php/events#Cancellable-events
It states that there is no error returned to the user if it returns false as of version 1.6, as we are now on a later version, I was wondering if this was possible yet?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    Answer ✓

    No - there isn't a trivial way to do that yet. However, there is a different mechanism for this which will work, using global validation. Rather than using preCreate / preEdit you would add a validator that does whatever validation you need and have it return a string with the error message if you want to cancel the action.

    Would that suit your needs okay?

    Allan

  • gixxy22gixxy22 Posts: 15Questions: 7Answers: 1

    ah ok, must have missed that, yep i can work with that! thanks!

Sign In or Register to comment.