Multiple Edit forms
- Single Page
Posted 28 August 2012 - 13:03 PM
for example,
I can add/edit basic details (like Name, Email) with default add/edit buttons.
I need to add a custom action button (say 'Edit More details'). but this should be redirected to a different form with different fields.
please guide me how to do it if its possible.
Posted 12 October 2012 - 05:49 AM
Posted 12 October 2012 - 08:11 AM
function example()
{
$crud = new grocery_CRUD();
$crud->set_table('your_table');
$crud->columns(...);
if($this->input->get('method')=='more_details')
{
$crud->edit_fields('more','fields');
}
else
{
$crud->edit_fields('your','basic','fields');
}
$crud->add_action('basic details', '', '','',array($this,'more_details'));
$output = $crud->render();
$this->_example_output($output);
}
function more_details($primary_key , $row)
{
return site_url('demo/example/edit/'.$row->id.'?method=more_details');
}