Jump to content


luismiguells's Content

There have been 3 items by luismiguells (Search limited from 19-January 20)


By content type

See this member's

Sort by                Order  

#31500 Fill a field with the information of a select

Posted by luismiguells on 25 September 2018 - 02:47 PM in I have a question

Hello everybody

 

I want to add a new record to a table, I want that when I use a select (green) the other field (red) is filled by itself but I don't know how to do this with grocery crud. I attach and image to ilustrate what I want.

 

 

 

image.png




#29195 View Text in GC

Posted by luismiguells on 18 September 2018 - 05:15 PM in I have a question

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

Could you please share your solution?




#16517 [WORKAROUND] Redirect to the list after insert/update without changing the co...

Posted by luismiguells on 06 September 2018 - 02:24 PM in How to and FAQs

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.