⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Error When inserting or editing a record



trongnhanst94
  • profile picture
  • Member

Posted 14 April 2017 - 09:00 AM

I am using Bootstrap and Grocery Crud. When inserting or editing a record, then clicking Update Changes, the only thing that appears on the screen is a textarea with the following ...

{"success":true,"insert_primary_key":533,"success_message":"

Your data has been successfully stored into the database. Edit Record<\/a> or Go back to list<\/a><\/p>","success_list_url":"http:\/\/localhost\/pm\/index.php\/backend\/products\/index\/success\/533"}

 

Others on this forum have reported this behavior too.

Any idea what to do to fix? i am using "$crud->unset_jquery();" but it's not working

 

 

Screenshot-1.png

Thanks

 


Amit Shah
  • profile picture
  • Member

Posted 16 April 2017 - 04:04 AM

check your source code of the same generated - you either may find in no jquery defined or you may end up seeing atleast 2 jQuerry library been called up for. If so - there ight be possibility that youu are calling the library at theme level and then GroceryCrud is calling it at its base level. This can cause an issue. Try unset_kquery() in your code and run the page. See if there is any trouble in the console.log - first priority wil be for yo to fix that. If that is sorted, yor issue should disappear.

 

Happy GCing:)


leffert
  • profile picture
  • Member

Posted 16 April 2017 - 21:39 PM

I also got this when trying to load css an js manually. GC loads different files dynamically.

So if you by any chance did the same mistake, you need to load them by:

// scripts from grocery crud...
if(isset($crud)){
$css_files=$crud->css_files ;
$js_files=$crud->js_files ; }
if(isset($css_files)){
	foreach($css_files as $file): ?>
		<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; }?>
		
<?php	if(isset($js_files)){
        foreach($js_files as $file): ?>
		<script src="<?php echo $file; ?>"></script>
<?php endforeach; }?>