First, thank you to the creators, this is incredibly useful and awesome!
Hello all, I am a newbie, learning Code Igniter and Grocery Crud, I apologize if this question is too simple, but I cannot get this to work. It seems simple, but I am stumped.
I am following this post: /topic/324-workaround-redirect-to-the-list-after-insertupdate-without-changing-the-core-functionality-of-gc/
I would like to redirect the user to a different controller when they are in the "add" state and click the "save" button.
My controller is "controller_site", my function is "crud_daily_reports", and this function has a "callback_after_insert" that references a second function "redirect_to_month" that handles the redirect.
Here is my callback_after_insert:
$crud->callback_after_insert(array($this, 'redirect_to_month'));
The function "redirect_to_month" looks like this.
function redirect_to_month() { $controller = "controller_site"; $function = "my_monthly_reports"; $crud->set_lang_string('insert_success_message', 'Your data has been successfully stored into the database.<br/>Please wait while you are redirecting to the list page. <script type="text/javascript"> window.location = "'.site_url($controller.'/'.$function).'"; </script> <div style="display:none"> ' ); }
The entire function is kind of long so I attached it as a file just in case more information is needed.
I think I am doing something wrong with array data that is passed from callback_after_insert, but am new enough to be unsure. Ok, thanks everyone.
Jason