From 211276847f580e314d253e6dd7e77dbbbb4ff7cd Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 17 May 2018 16:54:04 -0400 Subject: [PATCH] fix(dataview): preserve any previous sort when resetting items (#62) Resetting the dataview items will remove any sorts that were on the grid. You can duplicate this bug in example3 as such: ``` dataviewChanged(dataview) { this.dataview = dataview; const data = [ ...this.dataview.getItems() ] // you have 6 seconds to sort the grid and then watch it go back to the original setTimeout(() => this.dataset = data, 6000); } ``` --- aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts b/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts index 7a2c52d74..207a783ec 100644 --- a/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts +++ b/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts @@ -455,6 +455,7 @@ export class AureliaSlickgridCustomElement { refreshGridData(dataset: any[], totalCount?: number) { if (dataset && this.grid && this.dataview && typeof this.dataview.setItems === 'function') { this.dataview.setItems(dataset, this.gridOptions.datasetIdPropertyName); + this.dataview.reSort(); // this.grid.setData(dataset); this.grid.invalidate();