3

I'm using Codeigniter and Grocery Crud for a project. The crud seems to be working fine but the problem is that when I try to add values, I don't get the success message. Instead I get a textbox like below

enter image description here

I tried reinstalling the crud from scratch but still the same.

add and update doesn't show the success message and when I click on update and goto to the list nothing happens.

Can someone please help me on this?

cyberhicham
  • 495
  • 1
  • 10
  • 24
LiveEn
  • 3,193
  • 12
  • 59
  • 104
  • The {} suggests that you're using some sort of template engine ? – cyberhicham Jan 30 '13 at 16:48
  • @HichamLEMGHARI i using only grocery crud with codeigniter. im also using a html template for the view design. will the html template cause this problem? – LiveEn Jan 30 '13 at 16:58
  • I'm pretty sure of that, from your capture I'm quite sure that grocery crud has nothing to do with your error :), just try without the html template. – cyberhicham Jan 30 '13 at 17:06
  • @HichamLEMGHARI yeh.. when i just output it seems to be working fine.. could you please point me where that i need to look see whats causing this problem? – LiveEn Jan 30 '13 at 17:26
  • I suggest you ask another question for your 'template' problem with the appropriate code like your controller/view code... which template do you use, and how you implement it, stuff like that – cyberhicham Jan 30 '13 at 18:21
  • Looking at the code grocery crud completed the process and data had been added/updated but the JS wont parse properly, it is either from your template OR the URL settings. – tomexsans Jan 30 '13 at 23:26

2 Answers2

4

Actually it is good to ask, as it is a common error on grocery CRUD when there is a JavaScript error. This is mainly a problem when there is a JavaScript error at the previous page.

For example when you are at your add form . For example: http://www.grocerycrud.com/demo/offices/add check your firebug to see if there is any JavaScript error. This is mostly happen when you have the jquery or the jqueryUI already at your JavaScripts . If so then to prevent the conflict, a simple line of code can release you from the searching. You can simply do:

$crud->unset_jquery(); //This will unset the Jquery library to load 

or:

$crud->unset_jquery_ui(); //This will unset the Jquery UI library to load 

If you are still having problems, check your JavaScripts and try to remove some plugins that can cause this problem. Some times it happens when the Twitter Bootstrap is installed, but just the unset_jquery() method could do the job.

And something lastly I am not sure but I think that the latest grocery CRUD version is not compatible with Jquery v.1.9.0 . So if you are using Jquery 1.9.0, try to switch to a previous version e.g. 1.8.3 or you have to wait for the major release of grocery CRUD v.1.4 that will support Jquery v.1.9.0 .

John Skoumbourdis
  • 3,041
  • 28
  • 34
  • I have same issue, I tried waht you said, but can not solve it, I checked js files but everything seems ok – edgarmtze Mar 14 '13 at 18:49
0

In case anyone is running into this issue I believe this is a Template issue but with no more time to diagnose I simply set the success_message to null in the update_layout function in the Grocery_CRUD.php library.

This eliminates the error but of course, does not include the success message.

JoshOiknine
  • 470
  • 5
  • 15