HI,
I have calculated an age by date of birth(dob) field from my database and I am able to calculate age and display it on list page.
But on view/read page all fields value displaying as expected, except age. Below is my code -
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('ci_users');
$crud->set_subject('User');
$crud->required_fields('empcode', 'firstname', 'lastname', 'email', 'phone', 'password', 'department', 'role', 'status');
$crud->columns('empcode', 'firstname','lastname','email','phone','department', 'role', 'status', 'designation', 'team','Tenure','supervisor','created_date');
$crud->fields('empcode', 'firstname','lastname','email','phone','department', 'role', 'status', 'designation', 'team','supervisor','Tenure');
$crud->callback_column('created_date', array($this, 'callback_date'));
//this field I want to display on my read/view page
$crud->callback_column('Tenure', array($this, 'callback_calculate_tenure'));
// Field Setup
$crud->change_field_type('password','password');
// Relations
$crud->set_relation('supervisor','ci_users','{firstname} {lastname}');
$crud->set_relation('department','ci_departments','department');
$crud->set_relation('role','ci_roles','roles');
$crud->set_relation('status','ci_status','status');
$crud->set_relation('designation','ci_designations','designation');
$crud->set_relation('team','ci_teams','team');
$crud->unique_fields('email');
$crud->set_rules('email', 'Email', 'required|valid_email');
$output['output'] = $crud->render();
$output['title'] = "abc";
$output['userrole'] = $this->session->userdata('role');
$output['pagehead'] = "User Management";
$output['output'] = $crud->render();
So what is wrong with my code,why age is not showing on read page.
Note:- I am using version 1.4.2