define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-inputs", "../base/util"], function (require, exports, ej2_base_1, ej2_base_2, ej2_inputs_1, util_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var NumericEditCell = (function () {
function NumericEditCell(parent) {
this.parent = parent;
}
NumericEditCell.prototype.create = function (args) {
var complexFieldName = util_1.getComplexFieldID(args.column.field);
return ej2_base_2.createElement('input', {
className: 'e-field', attrs: {
id: this.parent.element.id + complexFieldName,
name: complexFieldName, 'e-mappinguid': args.column.uid
}
});
};
NumericEditCell.prototype.read = function (element) {
element.blur();
return element.ej2_instances[0].value;
};
NumericEditCell.prototype.write = function (args) {
var col = args.column;
var isInline = this.parent.editSettings.mode !== 'Dialog';
this.obj = new ej2_inputs_1.NumericTextBox(ej2_base_1.extend({
value: parseFloat(util_1.getObject(args.column.field, args.rowData)),
enableRtl: this.parent.enableRtl,
placeholder: isInline ? '' : args.column.headerText,
enabled: util_1.isEditable(args.column, args.requestType, args.element),
floatLabelType: this.parent.editSettings.mode !== 'Dialog' ? 'Never' : 'Always',
}, col.edit.params));
this.obj.appendTo(args.element);
args.element.setAttribute('name', util_1.getComplexFieldID(args.column.field));
};
NumericEditCell.prototype.destroy = function () {
Eif (this.obj && !this.obj.isDestroyed) {
this.obj.destroy();
}
};
return NumericEditCell;
}());
exports.NumericEditCell = NumericEditCell;
});
|