Hi All,
I am newbie on grocery crud, i want to ask about "order_by" function on datatable theme, it's not working for descending order.
i am using grocery crud version 1.4.1
PFB my code.
public function sic() {
$crud = new grocery_CRUD();
$crud->set_subject('SIC')
->set_table('im_sic')
->set_theme('datatables')
->set_relation('sic','im_master_member','member')
->columns('ID','sic_id','sic','from_date','end_date')
->fields('ID','sic_id','sic','from_date','end_date')
->order_by('ID','desc')
->callback_add_field('sic_id',array($this,'add_callback_sic_id'))
->unset_read()
->add_action('Print', '', 'shift/print','ui-icon-plus')
->add_action('Sic Incident', '', 'shift/incident','ui-icon-plus')
->add_action('Sic PW', '', 'shift/plannedwork','ui-icon-plus');
if ($this->session->userdata('usergroup') == 'User') {
$crud->unset_operations();
}
//define title
$data=array();
$data['title']='Shift in Charge';
$output = $crud->render();
//creating the title
$output->data=$data;
$this->shift_output($output);
}
i read suggestion from scoumbourdis on the forum, already applied on the core, but still not working.
https://github.com/scoumbourdis/grocery-crud/commit/f37a7948683be57321d1d502a310a1c7021a495d
Please gave suggestions for this issue, i want the last data input shown on the 1st record.
Cheers,
Amir Rachman