javascript - How to add an extra column to data table for serializing the data in grocery crud -


i new grocery crud. want add column serial number , not change on search , pagination. want jqgrid. possible? please me.

try type of code

public function customers_management() {  //this process important reset last serial no... $page = $this->input->get_post('page'); if($page == '') {     $page=1; } else {     $per_page = $this->input->get_post('per_page');     $start = ($page-1) * $per_page;     $this->session->set_userdata('lastserial', $start); }  $this->load->library('grocery_crud_with_tab'); $crud = new grocery_crud_with_tab();  $crud->set_table('customers'); $crud->columns('serial_no', 'customername','contactlastname','phone','city','country','salesrepemployeenumber','creditlimit'); $crud->display_as('salesrepemployeenumber','from employeer') ->display_as('customername','name') ->display_as('contactlastname','last name'); $crud->set_subject('customer'); $crud->set_relation('salesrepemployeenumber','employees','lastname'); $crud->callback_column('serial_no', array($this, 'generateserialno'));  $crud->set_tab('default',  'customer details', array('customername', 'salesrepemployeenumber', 'creditlimit')); $crud->set_tab('contact', 'customer contact', array('contactlastname', 'contactfirstname', 'phone')); $crud->set_tab('address', 'customer address', array('addressline1', 'addressline2', 'city', 'state', 'postalcode', 'country'));  //this written exclusively because jquery ui provided version of grocery crud dose not posses tabs function.. hence had  //set same cloud. $crud->unset_jquery_ui(); $crud->unset_jquery(); $crud->set_css('//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css', false); $crud->set_js('//code.jquery.com/jquery-1.11.0.min.js', false); $crud->set_js('//code.jquery.com/ui/1.10.4/jquery-ui.js', false);  $output = $crud->render(); $this->_example_output($output); }   function generateserialno() { if($this->session->userdata('lastserial') == '') {     $this->session->set_userdata('lastserial', 0);     $this->session->set_userdata('lastpage', 1);     $lastserial = 0; } else {     $lastserial = $this->session->userdata('lastserial'); } $lastserial++; $page = $this->input->post('page'); if($page != '') {     $this->session->set_userdata('lastpage', $page); } else {     $this->session->set_userdata('lastpage', 1); } $this->session->set_userdata('lastserial', $lastserial);  return $lastserial; } 

Comments