Jump to content


Linkark07

Member Since 21 Aug 2014
Offline Last Active Sep 10 2014 02:08 PM
-----

Topics I've Started

Add/Edit/Delete using where as a variable

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)
                {
                    $this->seleccionar_grupo();
                }else{
                $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_subject('Participante');
        $this->grocery_crud->set_relation('id_participante', 'participante', 'numero_identificacion');
              $this->grocery_crud->set_table('asistencia');
    $this->grocery_crud->edit_fields('clase', 'observaciones');
       $this->grocery_crud->unset_delete();
                $this->grocery_crud->unset_add();
                $this->grocery_crud->unset_export();
                $this->grocery_crud->unset_print();
            $output = $this->grocery_crud->render();
 
        $this->ver_lista($output);