Jump to content


Pedro Nogueira

Member Since 10 Jul 2014
Offline Last Active Aug 14 2014 04:05 PM
-----

Posts I've Made

In Topic: [WORKAROUND] Redirect to the list after insert/update without changing the co...

09 August 2014 - 06:24 PM

Hi, I'm a newbie with grocerycrud, I'm trying to use this code, but it doesn't work:

 

$crud->callback_after_insert(array($this, 'redirect'));

 

function redirect($post_array,$primary_key)
{
$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('actions/actions_/add').'";
</script>
<div style="display:none">
'
);
  }
 
On firebug console I get : "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"
 
Thanks for your help