I need to see different fields when I'm in add or in edit, so I have
$crud->add_fields('my_id');
Also, to choose "my_id" I have a custom select, so I have
$crud->callback_add_field('my_id', array($this, 'my_select'));
$crud->callback_edit_field('my_id', array($this, 'my_select'));
And my callback function, to test
function my_select($value)
{
$input = "<select name='my_id' id='' class='chosen-select' data-placeholder='Select ...'>";
$input .= "<option value=''></option>";
$input .= "<option value=''>Hello</option>";
$input .= "</select>";
return $input;
}
In edit everything is ok

But see what happens in add

If I don't use the $crud->add_fields('my_id'); everything is all right.
