How to add default value when use fieldType in enterprise? In other version works like this
$crud->field_type('status', 'hidden', 'ACTIVE');
example but in the new version not working.
How to add default value when use fieldType in enterprise? In other version works like this
$crud->field_type('status', 'hidden', 'ACTIVE');
example but in the new version not working.
Doc :
Hope it’s useful.
Hello @barrcode ,
You should use: callbackAddForm and/or callbackEditForm instead.
For example in your case you should do something like this:
$crud->field_type(‘status’, ‘hidden’);
$crud->callbackAddForm(function ($data) {
$data['status'] = 'ACTIVE';
return $data;
});
$crud->callbackEditForm(function ($data) {
$data['status'] = 'ACTIVE';
return $data;
});
nice really thank u, Johnny