⚠ 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

Merging groceryCRUD into my site



imster
  • profile picture
  • Member

Posted 23 February 2012 - 16:15 PM

Hello,
First of all, let me say that groceryCRUD is wonderful. However, i'm having an issue:[list=1]
[*]How do integrate the example.php view into my view. What I mean is, i have a view that basically has a chained dropdown. For example, if i select subject from the first dropdown, the list of subjects shows in the second dropdown. What i want to do now is on selecting the subjects from the second dropdown, the example.php view should be loaded with the filtered data. Currently, i'm achieving thus using a iframe, but is there any better solution?
[/list]

naufal
  • profile picture
  • Member

Posted 19 March 2012 - 16:46 PM

There are two ways to do this, using ajax or no ajax.
1. (ajax) when onchange second dropdown, post the parameter value to grocery_crud controller and load just the example view
2. (no ajax) when onchange second dropdown, put the parameter on URI and then grocery_crud controller get the URI segment to where statement.

This is my working controller load example view in home view.
       
$data = $form1->render();
$data->title = 'Seleksi';
$data->main = 'example'; // example view
$this->load->view('home',$data); // home view


load the example view <? $this->load->view($main); ?>