Skip to content

Commit

Permalink
fix: externalResouces should also work globally
Browse files Browse the repository at this point in the history
- relates to issue #1329 even though the issue was brought for the new v7, this regression was also pushed on last v6.6.5 so a fix is necessary on v6 as well
  • Loading branch information
ghiscoding committed Dec 15, 2023
1 parent d5e6060 commit 6afc9e9
Showing 1 changed file with 4 additions and 3 deletions.
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 = Slick.Utils.extend(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 6afc9e9

Please sign in to comment.