Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I hide only tool panel from ag-grid enterprise? #1137

Closed
abhishek2016 opened this issue Sep 15, 2016 · 16 comments
Closed

How can I hide only tool panel from ag-grid enterprise? #1137

abhishek2016 opened this issue Sep 15, 2016 · 16 comments

Comments

@abhishek2016
Copy link

Is it possible to hide only the 'Tool Panel' in ag-grid? It is possible to hide entire main panel by setting 'suppressMenuMainPanel' to true. But I want to hide only the tool panel. How can I do it? Please help as soon as possible.
ag-grid-issue

@ceolter
Copy link
Contributor

ceolter commented Sep 15, 2016

you can customise the menus. see the docs on the column menu and context menu. then get the default menu values, remove the toolpanel item, then return the new list with the toolpanel item.

@ceolter ceolter closed this as completed Sep 15, 2016
@re5ive
Copy link

re5ive commented May 9, 2017

how do i do this on react component??

<AgGridReact
// listen for events with React callbacks
onRowSelected={this.onRowSelection.bind(this)}
onCellClicked={this.onCellClicked.bind(this)}
onGridReady={this.onGridReady.bind(this)}
// binding to properties within React State or Props
// column definitions and row data are immutable, the grid
// will update when these lists change
columnDefs={this.props.flightGridColumns}
rowData={this.props.flights}
enableFilter={false}
floatingFilter="true"
// or provide props the old way with no binding
rowSelection="single"
enableSorting="true"
rowHeight="40"
animateRows="true"
headerHeight="80"
/>

here is my DOM

@sekoyo
Copy link

sekoyo commented Mar 22, 2018

How can I disable the tool panel in v17? The docs don't mention it here https://www.ag-grid.com/javascript-grid-tool-panel/ (showToolPanel=false doesn't work)

@amie-wilt
Copy link

amie-wilt commented Mar 22, 2018

I can't find where to hide it either. I just upgraded to v17 and it's showing by default and showToolPanel=false doesn't work for me either. I'm currently hiding it with CSS (.ag-tool-panel { display: none;}) but I feel there should be a way to do it in the grid options.

@sekoyo
Copy link

sekoyo commented Mar 22, 2018 via email

@amie-wilt
Copy link

That's leaving a big empty space for me where the tool panel would otherwise be:

screen shot 2018-03-22 at 4 47 47 pm

@amit-metkar
Copy link

I'm getting similar behavior when toolPanelSuppressSideButtons set to true, it leaves empty space, that doesn't look good at all. Is it fixed?

@sstorie
Copy link

sstorie commented Apr 6, 2018

Is this at all related to this possible issue:

image

After upgrading to v17 I see this shown all the time and I can't figure out how to get rid of it. I am an enterprise customer if that helps get any attention :)

@sliceofbytes
Copy link

@dominictobias, thank you!

[toolPanelSuppressSideButtons]="true"

works for me.

@re5ive
Copy link

re5ive commented Apr 17, 2018

below code works for me

    getMainMenuItems(params){
        let finalMenuItem = [];
        let itemsToExclude = "toolPanel";
        params.defaultItems.forEach(function(item) {
            if (itemsToExclude.indexOf(item) < 0) {
                finalMenuItem.push(item);
            }
        });
        return finalMenuItem;
    }

in grid property getMainMenuItems={this.getMainMenuItems.bind(this)}

@sekoyo
Copy link

sekoyo commented Apr 26, 2018

Any idea how to filter menu items in the react version? getMainMenuItems seems to have no effect

@lancevo
Copy link

lancevo commented May 17, 2018

@ceolter Any resolution for the empty space issue like shown above by amie-wilt?

@choisel
Copy link

choisel commented Jun 14, 2018

@Iancevo I used api.toolPanelComp.setVisible(true/false)
It doesn't leave the empty space.

I opened a feature request for this. #2433 feel free to comment there

@re5ive
Copy link

re5ive commented Jul 8, 2018

@dominictobias

    getMainMenuItems(params){

        let MenuItems = params.defaultItems.filter( item => item !== 'toolPanel' )
        // MenuItems = MenuItems .slice(0);

        return MenuItems ;
    }

..and u have to bind the function in grid property like below

<AgGridReact
getMainMenuItems={this.getMainMenuItems.bind(this)}
/>

ES6

getMainMenuItems(params){
    return params.defaultItems.filter item => item !== 'toolPanel' 
}

@blackgirlbytes
Copy link

Thank you so much @re5ive . that first example was perfect.

@paikerabbas
Copy link

I found out it’s toolPanelSuppressSideButtons but it’s not in any docs as far as I can tell (surprise surprise)

On Thu, 22 Mar 2018 at 14:21, Amie Wilt @.***> wrote: I can't find where to hide it either. I just upgraded to v17 and it's showing by default and showToolPanel=false doesn't work for me either. I'm currently hiding it with CSS (`.ag-tool-panel { display: none;}) but I feel there should definitely be a way to do it in the grid options. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1137 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuZ-lSNPC0hA9bjRdpzkDiVmQV_VNtAks5tg7NfgaJpZM4J9pG0 .

Thanks @dominictobias
[toolPanelSuppressSideButtons]="true" works for me .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests