Skip to content

Commit

Permalink
Merge pull request #1330 from ghiscoding/bugfix/global-register-resou…
Browse files Browse the repository at this point in the history
…rce-v4

fix: externalResouces should also work globally
  • Loading branch information
ghiscoding authored Dec 15, 2023
2 parents d5e6060 + 3da87b5 commit 67f70af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- master
- version6
- next
pull_request:
branches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,18 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy {

// save resource refs to register before the grid options are merged and possibly deep copied
// since a deep copy of grid options would lose original resource refs but we want to keep them as singleton
this._registeredResources = this.gridOptions?.externalResources || this.gridOptions?.registerExternalResources || [];
const extendedGridOptions = { ...GlobalGridOptions, ...this.forRootConfig, ...this.gridOptions } as GridOption;
this._registeredResources = extendedGridOptions?.externalResources || extendedGridOptions?.registerExternalResources || [];
/* istanbul ignore if */
if (this.gridOptions?.registerExternalResources) {
if (extendedGridOptions?.registerExternalResources) {
console.warn('[Angular-Slickgrid] Please note that the grid option `registerExternalResources` was deprecated and will be removed in next major, please use `externalResources` instead.');
}

this.initialization(this._eventHandler);
this._isGridInitialized = true;

// recheck the empty warning message after grid is shown so that it works in every use case
if (this.gridOptions && this.gridOptions.enableEmptyDataWarningMessage && Array.isArray(this.dataset)) {
if (this.gridOptions?.enableEmptyDataWarningMessage && Array.isArray(this.dataset)) {
const finalTotalCount = this.dataset.length;
this.displayEmptyDataWarning(finalTotalCount < 1);
}
Expand Down

0 comments on commit 67f70af

Please sign in to comment.