callback edit/add field
- Single Page
Posted 07 November 2012 - 13:06 PM
exaple:
$crud->callback_edit_field($field, array($this, '_function_callback'), $myvar);
then in my _function_callback just to retriev myvar
Posted 07 November 2012 - 14:33 PM
Posted 07 November 2012 - 15:07 PM
there is a third parameter which is an object and has the info for the relation_n_n (which was what i needed in my case)
Posted 08 November 2012 - 11:51 AM
in the grocery_crud controller class:
function facturas()
{
$crud = new grocery_CRUD();
$crud->set_language("spanish");
$crud->set_table('factura');
$crud->columns('factura_id','clientefacturado_id','matricula_id',,'factura');
$crud->callback_column('factura',array($this,'goMenuFacturas'));
$output = $crud->render();
}
function goMenuFacturas($value, $row)
{
$atts = array('target' => 'dentrodematricula');
$tmp = anchor_popup("post2get/veralgo/".$row->matricula_id,"<small>ver algo</small>",$atts);
return $tmp;
}
next in another controller (post2get) i pass the data to a session :
function veralgo($matricula_id)
{
$this->session->set_userdata('matricula_id',$matricula_id);
redirect('facturas_crud/another');
}
returning to the grocery controller:
function another()
{
$matricula_id = $this->session->userdata('matricula_id'); // HERE
$crud = new grocery_CRUD();
$crud->set_language("spanish");
$crud->set_table('xyz');
...
$output = $crud->render();
}
Posted 15 November 2013 - 10:55 AM
xxaxxo.. Yes you right. "sessions are unusable if you have multiple relation_n_n"
did you solve it?
Posted 15 November 2013 - 13:45 PM
Posted 17 November 2013 - 18:59 PM