0

I have a CI view which uses jquery tab to show some content. One of the tabs loads another controller which uses grocery crud. So the initial display is embeded inside this view. However if I try to edit or update it opens it in a completely seperate page and from then all actions on the grocery crud is in a separate page. How can I embed grocery crud inside a CI view?

la6470
  • 29
  • 2
  • 6

2 Answers2

3

This is not yet supported in grocery CRUD but it will be supported as for the new big release of version 1.4 that it is not yet released. If you like to implement the alpha version at your project, you can simply download the latest zip file from github https://github.com/scoumbourdis/grocery-crud (https://github.com/scoumbourdis/grocery-crud/archive/master.zip) and simply go to: application/config/grocery_crud.php and change the line:

   $config['grocery_crud_dialog_forms'] = false;

to:

   $config['grocery_crud_dialog_forms'] = true;

That's it actually :) . You can see some scrennshort to make sure that this is what you need.

enter image description here

enter image description here

I suggest though for you to wait, at least for the BETA version to release, as it is not 100% done yet.

John Skoumbourdis
  • 3,041
  • 28
  • 34
  • Wow! That is pretty great and is exactly what I am looking for. I tried the alpha code and I have a couple of comments/questions:
    1) After I edit or update it still opens up a new screen with the list . Ideally it should go back to the original view and refresh the list there automatically. Hopefully this will be available in the beta of final release ?
    2) Does it differentiate between embedded views and non-embedded ones. Because when I tried the non-embedded view it still displays everything in different page as expected. This is good but I am just curious.
    Thanks again :)
    – la6470 Feb 17 '13 at 14:33
  • 1) Yeap, I've already know these kind of issues and the BETA will actually be the final one without those small issues that you had. 2) There is not actually any difference. The only difference is that the non-embeded one loads at his own page. There is also the benefit that the user can copy the URL as well. I want to the developer to have this choice as for me it is really important to render the forms with both ways. Stay tuned at: https://github.com/scoumbourdis/grocery-crud ;-) – John Skoumbourdis Feb 17 '13 at 22:18
  • Thanks for your response. Grocery Crud is awesome and it has helped me accelerate development work for a newbie like me multiple times. Please keep up the good work. We need more software like yours. BTW I simply used the unset_back_to_list function and it is working for me :) – la6470 Feb 18 '13 at 06:58
0

you should allow sending csrf with the ajax call to allow loading the file with ajax when we use

$config['csrf_protection'] = TRUE;

what is the place that can i edit to send CSRF of codeigniter with the ajax call ?