⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Get value of table in Edit Form



jnainggolan
  • profile picture
  • Member

Posted 27 February 2017 - 13:43 PM

Hello,

 

I have view: as shown at capture view.

Then i click Edit as shown at capture.

 

I Have question :

how i can use the information Jenis Unit become where condition in my code.

public function ChooseOperator()
{
$comp = "1";
 
$crud = new grocery_CRUD();
 
$crud->set_theme('datatables');
$crud->set_table('projectunit');
$crud->set_relation_n_n('unitsc', 'projectunitselec', 'unit', 'idprojectunit', 'idunit', 'unitcode','priority',array('unit.sertifikatid' => $comp ));
//$crud->unset_columns('priority');
//$crud->add_action('Detail Unit', '', 'rmi/ChooseOperator/read','ui-icon-plus');
 
$crud->set_relation('proid','project','proname');
//$crud->set_relation('sertifikatid','sertifikat','sertifikatname');
$crud->fields('proid','sertifikatid','unitsc');
 
$crud->add_action('Detail Unit', '', 'rmi/ChooseOperator/edit','ui-icon-plus');
$crud->display_as('proid','Project Name');
$crud->display_as('sertifikatid','Jenis Unit');
$crud->display_as('unitsc','Unit Dipakai');
 
// $crud->fields('proname');
// $crud->display_as('proname','Nama Project');
// $crud->order_by('proname','asc');
// $crud->field_type('proid', 'hidden', $proid);
// /$crud->callback_column('proname',array($this,'_callback_webpage_url'));
$output = $crud->render();
 
$this->_rmi_output($output);
 
// print($proid);
// print_r($output);
}

 

 

So i want value of  $comp become a jenis Unit, why i need because i want only show specific information for set_relation.

really need a help ...

 

Regards,

 

 

 

 


jnainggolan
  • profile picture
  • Member

Posted 27 February 2017 - 14:52 PM

UP Please let me know if we can do that in Grocery CRUD?


xheradon
  • profile picture
  • Member

Posted 02 March 2017 - 12:59 PM

I dont know exactly what are you wanting for... But maybe u have to use callbacks.