post by barrcode on Apr 5, 2022

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.

21 days later

post by cybernicois on Apr 27, 2022

post by johnny on Apr 30, 2022

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;
});
3 months later

post by barrcode on Aug 6, 2022

1 / 4
Apr 2022