Skip to content

Hide column method in api #3902

@zaknuces

Description

@zaknuces

I need to hide / show columns of the grid after it is loaded (based on some permissions). I wasn't able to find a method in the grid api to call that can do it for me.

As a workaround, i am doing what hide column context menu is doing. Something like:

this.gridApiInterface.grid.columns[0].colDef.visible = hasDeletePermission;
this.gridApiInterface.grid.columns[0].visible = hasDeletePermission;
this.gridApiInterface.grid.queueGridRefresh();
                    this.gridApiInterface.grid.api.core.notifyDataChange(uiGridConstants.dataChange.COLUMN);                    this.gridApiInterface.grid.api.core.raise.columnVisibilityChanged(this.gridApiInterface.grid.columns[0]);

Having a quick method to do it would help.

Secondly, it will also be worthwhile to expose method to update 'enableRowHeaderSelection' property to control the visibility of selection column.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions