Jump to content


luismiguells

Member Since 05 Sep 2018
Offline Last Active Sep 28 2018 02:01 PM
-----

Posts I've Made

In Topic: View Text in GC

18 September 2018 - 05:15 PM

got a small solution callback column with $id, $obj ...

Could you please share your solution?


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

06 September 2018 - 02:24 PM

I know this is not a proper way to do it but if you want to have a redirection add insert and/or update operation without changing the functionality of grocery CRUD you can simply do:

for insert:

   $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(strtolower(__CLASS__).'/'.strtolower(__FUNCTION__)).'";
		 </script>
		 <div style="display:none">
		 '
   );
for update:
   $crud->set_lang_string('update_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(strtolower(__CLASS__).'/'.strtolower(__FUNCTION__)).'";
		 </script>
		 <div style="display:none">
		 '
   );

It works great but if you edit an entry it send you to the redirect page. How can I solve this problem? I want only redirect when I insert a new entry I alredy try with "callback_after_insert" but didn't work.