ci_bootstrap_3 icon indicating copy to clipboard operation
ci_bootstrap_3 copied to clipboard

Grocery_CRUD in view

Open XpamAmAdEuS opened this issue 8 years ago • 1 comments

Hi. I am having issues with position of CRUD in view. Is there a way to set CRUD inside like this

> <div class="panel panel-default">
>         <div class="panel-heading"><h4 class="text-center">Server settings</h4></div>
>         <div class="panel-body">
> 
> Put crud here ?
> 
> 
>         </div>
>     </div>

XpamAmAdEuS avatar Aug 11 '16 09:08 XpamAmAdEuS

To use Grocery CRUD within your custom view (instead of /application/modules/admin/views/crud.php), you can simply skip the Admin_Controller's render_crud() function and pass the CRUD object like:

$crud = $this->generate_crud('users');
$this->mViewData['crud'] = $crud;   // or use $this->mCrud
$this->render('my_view');

But then you will miss some functions from render_crud(), like you will need to add stylesheets / scripts to page manually - for reference please have a look on the render_crud() function from Admin_Controller.php

waifung0207 avatar Aug 22 '16 09:08 waifung0207