ghiscoding / Angular-Slickgrid

Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
https://ghiscoding.github.io/Angular-Slickgrid
MIT License
392 stars 117 forks source link

How to exclude a column header from the Grid Menu #189

Closed CragJWang closed 5 years ago

CragJWang commented 5 years ago

Hello,

I'm using some events to update the columns during running mode, I want to sync up the columns checkbox count in Grid menu, is there any way to do this? excludeFromHeaderMenu doesn't work for me even I set it before grid load.

ghiscoding commented 5 years ago

Hello, I think you have a misconception of what the Header Menu are and they are working fine in the demos. The Header Menu, which is not related to the Grid Menu, is the menu that shows up on top right right corner of a column header title.

As for the Grid Menu, they always display all column header title, including "Select All" checkbox. That comes from the core library (SlickGrid itself), and there is no way to exclude any. That is the expected behavior and not related to current lib. If you want to do something before the grid menu shows up or close or changes, you might be able to use some of the events fired, see all the Grid Menu Events and the Wiki on how to use them.

Lastly, please use the issue template for future issues. It helps in understanding the full issue in context, with a few simple questions to fill in.

You can see below, the header menu doesn't show on the "Select All" checkbox, and that is the correct behavior. 2019-05-16_09-16-04

ghiscoding commented 5 years ago

Reference, Created a new PR for a new option to exclude a column header from Grid Menu (see PR #376 and PR #377 for the Column Picker as well)

ghiscoding commented 5 years ago

Now released under version 2.7.0, there is now 2 new flags excludeFromGridMenu and excludeFromColumnPicker

You can also up vote ⭐️ if you like the lib Cheers

audrys commented 4 years ago

Hi, Installed Angular-Slickgrid version 2.7.0 excludeFromColumnPicker: true

columnDefinitions = ... { id: 'action', name:'Actions', field: 'id', excludeFromColumnPicker: true, formatter: myActionButton, minWidth: 70, maxWidth: 70, onCellClick: (e: Event, args: any) => { this.openEditSelector(args.dataContext); }

Action column still available and active in column picker. Can you help? R Audrius

ghiscoding commented 4 years ago

Latest version is 2.17.11 so 2.7.x would be fairly old... nonetheless the flag you're looking for is excludeFromGridMenu, you should have it through intellisense or take a look at the Column interface. There's 2 flags, 1 for the column picker and 1 for the grid menu.