Jump to content


Multiple Edit forms

edit forms multiple

  • Please log in to reply
2 replies to this topic

#1 John S Renor

John S Renor

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 28 August 2012 - 01:03 PM

I wonder if its possible to have different (multiple) edit forms using custom actions.
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.

#2 dwasden

dwasden

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 12 October 2012 - 05:49 AM

I have a similar request. How did you resolve this John? I want to show a button on the edit form only to allow a user to modify related data.

#3 victor

victor

    grocery CRUD Hero

  • Advanced Member
  • PipPipPip
  • 967 posts
  • LocationMinsk

Posted 12 October 2012 - 08:11 AM

Hi! You can to use the method "add_action".

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');
}






Also tagged with one or more of these keywords: edit, forms, multiple

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users