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
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Setting quick search values via JavaScript not working properly for booleans |
|
0 | 567 | Nov 2025 |
| callbackColumn() has not effect in v3.2.6 Enterprise |
|
2 | 699 | Dec 2025 |
| displayAs() doesn’t support new line in headings |
|
4 | 878 | Jan 5 |
| Inline edit has problems if the column width is set |
|
2 | 848 | Feb 28 |
| PRINT date format not consistent |
|
6 | 363 | Sep 7 |