Skip to content

Commit

Permalink
fix: Grid Menu filtering options should be removed when option disabl…
Browse files Browse the repository at this point in the history
…ed (#837)

- when creating a grid without enabling the filtering and we use Pagination, the Grid Menu might show options related to filtering and the reason is because internally we have to enable filtering to create the Pagination and then disable back the filtering option and we do that only once, but in some cases it might do this check a little too early before the SharedService is available and that would cause the filtering option to remain half enabled, we should simply wait for SharedService to be available before doing this swap
  • Loading branch information
ghiscoding committed Dec 6, 2022
1 parent 1c904d5 commit 9bc29d2
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -688,13 +688,11 @@ export class SlickVanillaGridBundle {

// when we use Pagination on Local Grid, it doesn't seem to work without enableFiltering
// so we'll enable the filtering but we'll keep the header row hidden
if (!options.enableFiltering && options.enablePagination && this._isLocalGrid) {
if (this.sharedService && !options.enableFiltering && options.enablePagination && this._isLocalGrid) {
options.enableFiltering = true;
options.showHeaderRow = false;
this._hideHeaderRowAfterPageLoad = true;
if (this.sharedService) {
this.sharedService.hideHeaderRowAfterPageLoad = true;
}
this.sharedService.hideHeaderRowAfterPageLoad = true;
}

return options;
Expand Down

0 comments on commit 9bc29d2

Please sign in to comment.