Frage

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?

War es hilfreich?

Lösung

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);    
}

Andere Tipps

Just do:

$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();

WITHOUT the $crud->columns and it should work for you as expected.

By the way you can use instead:

$crud->unset_operations(); //This is a shortcut to undet_add/edit/delete

for more you can check: http://www.grocerycrud.com/documentation/options_functions/unset_operations

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top