Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove first menu from ag-grid column menu

Tags:

ag-grid

Is there an option to remove first menu from ag-grid column menu? I mean the menu with 'pinSubMenu', 'valueAggSubMenu', 'autoSizeThis', etc.

I want to open the context menu and to see first the filter menu and second the columns visibility menu.

I tried to do this, but it still opens empty menu and I need to navigate to my filter menu:

function getMainMenuItems(params) {
    var countryMenuItems = [];
    var itemsToExclude = [
        'separator', 'pinSubMenu', 'valueAggSubMenu', 'autoSizeThis', 'autoSizeAll', 'rowGroup', 'rowUnGroup',
        'resetColumns', 'expandAll', 'contractAll','toolPanel'
    ];
    params.defaultItems.forEach(function(item) {
        if (itemsToExclude.indexOf(item) < 0) {
            countryMenuItems.push(item);
        }
    });
    return countryMenuItems;
}
like image 658
user2095956 Avatar asked Oct 22 '25 07:10

user2095956


1 Answers

Looks like you should be able to accomplish what you want to do within the gridOptions:

gridOptions = {
    ...
    suppressMenuMainPanel: true,
    ...
}

You can also suppress any of the panels of the column menu:

gridOptions = {
    ...
    suppressMenuMainPanel: true,
    suppressMenuColumnPanel: true,
    suppressMenuFilterPanel: true,
    ...
}

This is supposing that you are using the Enterprise version, which I assumed you were based on your usage of the getMainMenuItems function

like image 62
Jarod Moser Avatar answered Oct 25 '25 07:10

Jarod Moser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!