var sheetlyEditor = Handsontable.editors.TextEditor.prototype.extend();
sheetlyEditor.prototype.beginEditing = function (arg, event) {
var val = this.originalValue.value;
self.inEditor = true;
if (event) {
if (event.key && event.key !== 'F2' && event.key !== 'Enter' && event.key !== 'Dead') {
val = '';
}
}
Handsontable.editors.TextEditor.prototype.beginEditing.apply(this, [val]);
};
sheetlyEditor.prototype.saveValue = function (val) {
var _self = this;
if (_self.originalValue.value === val[0][0]) {
return;
}
var row = this.row;
var col = this.col;
var cellData = _self.originalValue;
self.inEditor = false;
_self.instance.setDataAtCell(row, col, response);
cellData.value = val[0][0];
_self.cellProperties.readOnly = true;
_self.instance.render();
$.ajax({
method: "PUT",
url: baseUrl + "update2",
data: cellData,
success: function (response) {
self.data.rows[row] = response;
// _self.instance.setDataAtCell(row, col, response);
_self.instance.setCellMeta(row, col, 'readOnly', false);
_self.instance.render();
},
});
};