From 48de363c266abfd76c34ca4f7befa4601b913c1f Mon Sep 17 00:00:00 2001 From: Jeremy Zagorski Date: Fri, 27 Apr 2018 08:06:23 -0400 Subject: [PATCH] fix(gridOptions): use this.gridOptions in bind fn using the first arg in the bind method looks at the parent context, which might not be the view-model with the `gridOptions`. For example in a repeat.for, the view-model properties are not available, which can be wrong if aurelia slickgrid in a repeat.for. Using `this.gridOptions` assures us we are using the options that are bound --- aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts b/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts index e922574d5..2d243c621 100644 --- a/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts +++ b/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts @@ -214,7 +214,7 @@ export class AureliaSlickgridCustomElement { */ bind(binding: any, contexts: any) { // get the grid options (priority is Global Options first, then user option which could overwrite the Global options) - this.gridOptions = { ...GlobalGridOptions, ...binding.gridOptions }; + this.gridOptions = { ...GlobalGridOptions, ...this.gridOptions }; // Wrap each editor class in the Factory resolver so consumers of this library can use // dependency injection. Aurelia will resolve all dependencies when we pass the container