rb-data-table
Version:
Angular Smart Table
42 lines • 1.32 kB
JavaScript
var Cell = /** @class */ (function () {
function Cell(value, row, column, dataSet) {
this.value = value;
this.row = row;
this.column = column;
this.dataSet = dataSet;
this.newValue = '';
this.newValue = value;
}
Cell.prototype.getColumn = function () {
return this.column;
};
Cell.prototype.getRow = function () {
return this.row;
};
Cell.prototype.getValue = function () {
var valid = this.column.getValuePrepareFunction() instanceof Function;
var prepare = valid ? this.column.getValuePrepareFunction() : Cell.PREPARE;
return prepare.call(null, this.value, this.row.getData(), this);
};
Cell.prototype.setValue = function (value) {
this.newValue = value;
};
Cell.prototype.getId = function () {
return this.getColumn().id;
};
Cell.prototype.getTitle = function () {
return this.getColumn().title;
};
Cell.prototype.isEditable = function () {
if (this.getRow().index === -1) {
return this.getColumn().isAddable;
}
else {
return this.getColumn().isEditable;
}
};
Cell.PREPARE = function (value) { return value; };
return Cell;
}());
export { Cell };
//# sourceMappingURL=cell.js.map