Change "on_insert" behavior on the fly

QuestionsChange "on_insert" behavior on the fly
Patricia Lawson asked 7 years ago

Hello,
I have a custom function that I run on insert: $e["on_insert"] = array("add_product", null, true); but I want to change the default behavior of the insert into the grid table based on data validation that is difficult to do during data input. Can I return a 'false' from my function and interrupt the data insert?
Thanks

1 Answers
Abu Ghufran answered 7 years ago

You can put die(); at any place inside callback to terminate further execution.
If you want to display some error message to user, you can use phpgrid_error('msg') function.

Refer demos/editing/server-validation.php for help

Your Answer

5 + 12 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?