Redirect after insert with inserted id

QuestionsRedirect after insert with inserted id
Cedric asked 1 year ago

Hello,

I try to redirect to another page after insert. I get the tips from other post:

$opt[“onAfterSave”] = “(function(){window.open(‘another_grid_page_here.php?id=$insert_id’,’_parent’);})();”;

$insert_id = $data[“Num_ticket”]; // it will hold newly inserted id

redirect works but I can’t pass the inserted id…

Any help appreciated.

Thanks

2 Answers
Abu Ghufran Staff answered 1 year ago

An approach could be to use on_after_insert event and you will get all posted data and inserted id there.

Docs: https://www.gridphp.com/docs/grid-events/

Code: https://gist.github.com/gridphp/4154071f305463a6f971b89d81fb0712

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Cedric answered 1 year ago

that worked thanks

Your Answer

8 + 10 =

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?