I am trying to use this function in my CodeIgniter Controller:
function details($projectID = '', $message = '')
{
$data = $this->userDetails();
$data['user_id'] = $this->tank_auth->get_user_id();
$data['username'] = $this->tank_auth->get_username();
$data['level'] = $this->tank_auth->get_userlevel();
if($projectID == '')
{
$projectID = $this->input->post('id');
}
$processTable = "process".$projectID;
// Grocery CRUD
$this->load->library('grocery_CRUD');
$crud = new grocery_CRUD();
$crud->set_table($processTable);
$crud->unset_export();
$crud->unset_print();
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
$crud->add_action('Process', '/images/load.png', 'process/process','ui-icon-plus');
$data['output'] = $crud->render();
$this->load->view('process/details', $data);
}
[You can see my tablename is variable.]
But when it renders on the view, it shows the data fine but the filter, sort, pagination, and search do not work.
If I set the set_table to one of the available tables, say [process1] then everything works fine in the view.
Is there a way to make one function work for one of many tables that have the same structure but different names?