Skip to content

Commit

Permalink
fix(table): fix #279 (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezeon authored and lexzhukov committed Apr 19, 2017
1 parent abc8a84 commit 4221b4c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ng2-smart-table/lib/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ export class Grid {
const deferred = new Deferred();
deferred.promise.then((newData) => {
newData = newData ? newData : row.getNewData();
if (deferred.resolve.skipAdd) {
this.createFormShown = false;
} else {
this.source.prepend(newData).then(() => {
this.createFormShown = false;
this.dataSet.createNewRow();
});
});
}
}).catch((err) => {
// doing nothing
});
Expand All @@ -124,9 +128,13 @@ export class Grid {
const deferred = new Deferred();
deferred.promise.then((newData) => {
newData = newData ? newData : row.getNewData();
this.source.update(row.getData(), newData).then(() => {
if (deferred.resolve.skipEdit) {
row.isInEditing = false;
} else {
this.source.update(row.getData(), newData).then(() => {
row.isInEditing = false;
});
}
}).catch((err) => {
// doing nothing
});
Expand Down

0 comments on commit 4221b4c

Please sign in to comment.