Search code examples
phpcodeignitergrocery-crud

How list all data in grocery crud without edit permission?


I have code like this

$crud->columns('a','b','c','d');
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();

Now a,b,c,d s are showing in grid. But total 20 field in table. So it is not possible to show all field in grid.How can i show all data in grocery crud?


Solution

  • You can show all columns from the table $crud->set_table('table_name');

        public function employees_example()
    {
        $crud = new grocery_CRUD();
    
        $crud->set_table('employees');
        $crud->unset_add();
        $crud->unset_edit();
        $crud->unset_delete();
        $output = $crud->render();
    
        $this->_example_output($output);                
    }
    
    function _example_output($output = null)
    
    {
        $this->load->view('our_template.php',$output);    
    }