[英]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,ds are showing in grid. 现在,a,b,c,ds显示在网格中。 But total 20 field in table.
但表中共有20个字段。 So it is not possible to show all field in grid.How can i show all data in grocery crud?
因此无法在网格中显示所有字段。如何显示杂货杂货中的所有数据?
Just do: 做就是了:
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
WITHOUT the $crud->columns
and it should work for you as expected. 没有
$crud->columns
,它应该可以按预期工作。
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 有关更多信息,请检查: http : //www.grocerycrud.com/documentation/options_functions/unset_operations
You can show all columns from the table $crud->set_table('table_name');
您可以显示表
$crud->set_table('table_name');
所有列$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);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.