define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Row = (function () {
function Row(options, parent) {
ej2_base_1.merge(this, options);
this.parent = parent;
}
Row.prototype.clone = function () {
var row = new Row({});
ej2_base_1.merge(row, this);
row.cells = this.cells.map(function (cell) { return cell.clone(); });
return row;
};
Row.prototype.setRowValue = function (data) {
if (!this.parent) {
return;
}
var key = this.data[this.parent.getPrimaryKeyFieldNames()[0]];
this.parent.setRowData(key, data);
};
Row.prototype.setCellValue = function (field, value) {
if (!this.parent) {
return;
}
var isValDiff = !(this.data["" + field].toString() === value.toString());
if (isValDiff) {
var pKeyField = this.parent.getPrimaryKeyFieldNames()[0];
var key = this.data["" + pKeyField];
this.parent.setCellValue(key, field, value);
this.makechanges(pKeyField, this.data);
}
else {
return;
}
};
Row.prototype.makechanges = function (key, data) {
if (!this.parent) {
return;
}
var gObj = this.parent;
var dataManager = gObj.getDataModule().dataManager;
dataManager.update(key, data);
};
return Row;
}());
exports.Row = Row;
});
|