field_type function is a general function that changes the field on add and edit forms.
If you need to change a field only on edit page then you need to use the callback_edit_field and modify it as required.
OK Thankyou. I used this instead
$state = $crud->getState();
if($state == "edit")
{
$crud->field_type('email','readonly');
$crud->field_type('activation_key','readonly');
$crud->field_type('recovery_code','readonly');
$crud->field_type('datetime_update','readonly');
$crud->field_type('datetime_delete','readonly');
$crud->field_type('datetime_create','readonly');
$crud->field_type('last_login','readonly');
$crud->unset_fields('status', 'notification_amount', 'password');
}
It's right way?