ng2-stable-nxtc
Version:
Angular Smart Table neXtCode Version
40 lines • 1.09 kB
JavaScript
export class Cell {
constructor(value, row, column, dataSet) {
this.value = value;
this.row = row;
this.column = column;
this.dataSet = dataSet;
this.newValue = '';
this.newValue = value;
}
getColumn() {
return this.column;
}
getRow() {
return this.row;
}
getValue() {
const valid = this.column.getValuePrepareFunction() instanceof Function;
const prepare = valid ? this.column.getValuePrepareFunction() : Cell.PREPARE;
return prepare.call(null, this.value, this.row.getData(), this);
}
setValue(value) {
this.newValue = value;
}
getId() {
return this.getColumn().id;
}
getTitle() {
return this.getColumn().title;
}
isEditable() {
if (this.getRow().index === -1) {
return this.getColumn().isAddable;
}
else {
return this.getColumn().isEditable;
}
}
}
Cell.PREPARE = (value) => value;
//# sourceMappingURL=cell.js.map