Skip to content

Commit

Permalink
fix(dataview): preserve any previous sort when resetting items (#62)
Browse files Browse the repository at this point in the history
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);
  }
```
  • Loading branch information
jmzagorski authored and ghiscoding committed May 17, 2018
1 parent 744d3f2 commit 2112768
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2112768

Please sign in to comment.