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
394 stars 117 forks source link

Grid menu option "showClearAllFiltersCommand" is always displayed #10

Closed sabeurch closed 6 years ago

sabeurch commented 6 years ago

When I set grid menu options as follow:

this.gridOptions = {
    ....,
    gridMenu: {
        showClearAllFiltersCommand: false,
        showToggleFilterCommand: false
    }
    ....,
}

This has no effect, clear filter and toggle filter commands are alwasy displayed.

I think, it has to do with those lines of code:

options.gridMenu.showClearAllFiltersCommand = options.gridMenu.showClearAllFiltersCommand || true;
options.gridMenu.showRefreshDatasetCommand = options.gridMenu.showRefreshDatasetCommand || true;
options.gridMenu.showToggleFilterCommand = options.gridMenu.showToggleFilterCommand || true;

in file "angular-slickgrid.js", Logic of "|| true" sets values always into true.

Would you please verify ?

Note: For the moment as a workaround, we can disable those commands from option "customItems", but it keeps them displayed as disabled.

ghiscoding commented 6 years ago

I believe that I have fixed this behavior couple weeks ago, it works on my side. The code implementation is to use the custom options first (if any), and if not found it will set it to true. There are 2 commands that should be available everwhere (1 refresh command is reserved to backend services).

I tried it in the demo project and it works as expected in the Client Side example and the GraphQL example.

sabeurch commented 6 years ago

Yes, version 0.8.1 works fine. Thank you !

ghiscoding commented 6 years ago

So we can close the issue?

sabeurch commented 6 years ago

Yes, please.