1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Is it possible to toggle( show/hide ) column menu in Ag Grid

Discussão em 'Angular' iniciado por Saurabh Sharma, Julho 3, 2025.

  1. I want to add conditional edit mode for ag grid so that user can only be allowed to pin /unpin show/hide column from menu after some action button click. I have tried to add "menuTabs" in column definition after action but it is not changing column headers. Please find below my current try

    // Initially. This works fine no column menu visible on grid

    this.gridColumns.map((column) => {
    column['menuTabs'] = [];
    return column;
    })

    // Conditional. Not working column menu still missing

    if (condition) {
    this.gridColumns.map((column) => {
    column['menuTabs'] = ["generalMenuTab",columnsMenuTab"];
    return column;
    });
    this.gridApi.setColumnDefs(this.gridColumns);
    this.gridApi.refreshHeader();
    }


    Thank you

    Continue reading...

Compartilhe esta Página