Jump to content

Add/Edit/Delete using where as a variable

Where Variable

  • Please log in to reply
1 reply to this topic

#1 Linkark07



  • Members
  • Pip
  • 1 posts

Posted 25 August 2014 - 12:49 PM

Good morning.


Thanks for making this great library. It has really helped me with my project.


My question, and problem, is this: how to use add/edit/delete and all the other options using where as a variable? Right now I'm doing an attendance list, and for it to work the user must select a group from a dropdown. This is when the problem comes in; the list with the selected group appears but the user can't use any of the options.


Here is the code:

$this->form_validation->set_rules('group', 'Grupo', 'trim|xss_clean');
                if($this->form_validation->run() == FALSE)
                $grupo = $this->input->get('grupo', TRUE);
                 $this->grocery_crud->where('id_grupo', $grupo); //Here is when I use a variable for get the group_id.
                     $this->grocery_crud->display_as('id_participante', 'C├ędula');
                      $this->grocery_crud->display_as('id_grupo', 'Grupo');
        $this->grocery_crud->set_relation('id_participante', 'participante', 'numero_identificacion');
    $this->grocery_crud->edit_fields('clase', 'observaciones');
            $output = $this->grocery_crud->render();

#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 04 September 2014 - 04:33 AM

what exactly you trying to achieve ..  can u explain - then i might be able to help you on the same.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users