Question

How to Disable/Unset Minimize and Maximize Option which is added by default in Grocery Crud table

Was it helpful?

Solution

I guess this happens in the flexgrid theme (the default theme of grocery).

To achieve this you will to change the default theme of grocery in order to use twitter bootstrap or datatables theme. You will use a function called set_theme for that. Here is a code sample of how to do this:

//this is a controller method
function offices_management()
{
    $crud = new grocery_CRUD();

    $crud->set_theme('twitter-bootstrap'); //change the theme here

    $crud->set_table('offices');
    $crud->set_subject('Office');
    $crud->required_fields('city');
    $crud->columns('city','country','phone','addressLine1','postalCode');

    $output = $crud->render();

    $this->_example_output($output);
}

If you need / want to use the default theme, then you will have to do the following steps:

1 - Open the file ../assets/grocery_crud/themes/flexigrid/views/list_template.php using some Editor (for example Notepad++ ou Sublime Text)

2 - Add comment around the mDiv block, in my case (grocery 1.4.1) it was at the line of number 46

<!-- <div class="mDiv">
    <div class="ftitle">
        &nbsp;
    </div>
    <div title="<?php echo $this->l('minimize_maximize');?>" class="ptogtitle">
        <span></span>
    </div>
</div> -->

3 - Save your file and test your application again (be sure to erase your browser cache)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top