I dont want to use the URI to prevent users from changing the info. I tryed the way bellow and it always returns the last item of the list (if ordered by id, the last id. If ordered by name, the id of the last name, etc)
I've tryed also $row->causa_id, or selecting the name, (select causa_nome where causa_id $primary_key), but its always the same.
Any help wold be apreciated.
function causas()
{
$this->ag_auth->restrict('admin', TRUE);
$crud = new grocery_CRUD();
$crud->set_table('causas')->order_by('causa_nome', 'ASC');
$crud->set_subject('Causas');
$crud->unset_operations();
$crud->columns('causa_nome','a_id','email','cat_slug_id','telefone1');
///////////Relações//////////
$crud->set_relation('cat_slug_id','categorias','cat_nome');
$crud->callback_column('a_id',array($this,'callback_column_1'));
$crud->required_fields('causa_nome');
$crud->add_action('Login', '', 'cms/registro','ui-icon-plus',array($this,'registro'));
$crud->add_action('Alterar', '', 'cms/alterar_causa','ui-icon-pencil');
$output = $crud->render();
$data['titulo'] = humanize($this->uri->segment(2));
$output = array_merge($data,(array)$output);
$this->_output_data($output);
}
function registro($primary_key, $row)
{
$this->session->set_flashdata('causa', $primary_key);
return site_url('register');
}