Skip to content

Commit

Permalink
fix(dataset): fix #15 columns list doesn't reset on columns change
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa committed Sep 2, 2016
1 parent 8d6b870 commit 2ebac0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ng2-smart-table/lib/grid.ts
Expand Up @@ -28,6 +28,10 @@ export class Grid {
setSettings(settings: Object): void {
this.settings = settings;
this.dataSet = new DataSet([], this.getSetting('columns'));

if (this.source) {
this.source.refresh();
}
}

getDataSet(): DataSet {
Expand Down
2 changes: 1 addition & 1 deletion src/ng2-smart-table/ng2-smart-table.component.ts
Expand Up @@ -167,6 +167,6 @@ export class Ng2SmartTableComponent implements OnChanges {
}

protected prepareSettings(): Object {
return deepExtend(this.defaultSettings, this.settings);
return deepExtend(this.settings, this.defaultSettings);
}
}

0 comments on commit 2ebac0f

Please sign in to comment.