Remove field from input/edit

1st way :

$crud->unset_fields(‘serial’,’nup’);

2nd way :

if ($crud->getState() == 'add') {

$crud->field_type('harga_barang', 'hidden');
 $crud->field_type('nup', 'hidden');
 $crud->field_type('serial', 'hidden');
 $crud->field_type('jumlah_disetujui', 'hidden');
 $crud->field_type('tanda_terima', 'hidden');
 }
 
 if ($crud->getState() == 'edit') {

$crud->field_type('harga_barang', 'hidden');
 $crud->field_type('nup', 'hidden');
 $crud->field_type('serial', 'hidden');
 $crud->field_type('jumlah_disetujui', 'hidden');
 $crud->field_type('tanda_terima', 'hidden');
 }

Leave a Comment

Your email address will not be published. Required fields are marked *