how to add the field_type('mycolumn','readonly') only in edit if I have a function like this?
public function users(){ if (!$this->ion_auth->logged_in()){ //redirect them to the login page redirect('auth/login', 'refresh'); }else{ $crud = new grocery_CRUD(); //$crud->set_theme('twitter-bootstrap'); $crud->set_subject('User'); $crud->set_table('users'); $crud->columns('first_name', 'last_name', 'email','address','city','postal_code', 'phone', 'groups', 'active') ->fields('first_name', 'last_name', 'email', 'address','city','postal_code','phone', 'groups', 'active', 'change_password', 'edit_password', 'edit_password_confirm') ->field_type('email','readonly') ->add_fields('email', 'first_name', 'last_name','address','city','postal_code', 'phone','groups', 'password', 'password_confirm') ->edit_fields('email', 'first_name', 'last_name','address','city','postal_code', 'phone', 'groups', 'active', 'change_password', 'edit_password', 'edit_password_confirm') ->set_relation('city','default_cities','name') ->set_relation_n_n('groups', 'users_groups', 'groups','user_id','group_id','description') ->change_field_type('change_password', 'true_false') ->change_field_type('edit_password', 'password') ->change_field_type('edit_password_confirm', 'password') ->set_rules('change_password', 'Change password', 'callback__change_password_check') ->set_rules('edit_password', 'Password', 'min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']') ->callback_edit_field('change_password',array($this,'_cb_change_password_field')) ->callback_edit_field('edit_password', array($this, '_cb_empty_password_input_field')) ->callback_edit_field('edit_password_confirm', array($this,'_cb_empty_password_confirm_input_field')) ->callback_before_update(array($this, '_cb_user_password_update')); $output = $crud->render(); $this->kekgwpeduliaja($output); } }
Thanks!