Skip to content

Commit

Permalink
feat(table): allow for default value to be set for new cells (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezeon authored and lexzhukov committed Apr 19, 2017
1 parent 9920b3c commit 9065c52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ng2-smart-table/lib/data-set/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export class Row {
}

createCell(column: Column): Cell {
const value = typeof this.data[column.id] === 'undefined' ? '' : this.data[column.id];
const defValue = (column as any).settings.defaultValue ? (column as any).settings.defaultValue : '';
const value = typeof this.data[column.id] === 'undefined' ? defValue : this.data[column.id];
return new Cell(value, this, column, this._dataSet);
}
}

0 comments on commit 9065c52

Please sign in to comment.