@syncfusion/ej2-grids
Version:
Feature-rich JavaScript datagrid (datatable) control with built-in support for editing, filtering, grouping, paging, sorting, and exporting to Excel.
44 lines (43 loc) • 1.96 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { extend } from '@syncfusion/ej2-base';
import { MaskedTextBox } from '@syncfusion/ej2-inputs';
import { isEditable, getObject, parentsUntil, isCellHaveWidth } from '../base/util';
import { EditCellBase } from './edit-cell-base';
/**
* `MaskedTextBoxCellEdit` is used to handle masked input cell type editing.
*
* @hidden
*/
var MaskedTextBoxCellEdit = /** @class */ (function (_super) {
__extends(MaskedTextBoxCellEdit, _super);
function MaskedTextBoxCellEdit() {
return _super !== null && _super.apply(this, arguments) || this;
}
MaskedTextBoxCellEdit.prototype.write = function (args) {
this.column = args.column;
var isInlineEdit = this.parent.editSettings.mode !== 'Dialog';
this.obj = new MaskedTextBox(extend({
fields: { value: args.column.field },
value: getObject(args.column.field, args.rowData),
floatLabelType: isInlineEdit ? 'Never' : 'Always',
mask: '000-000-0000',
enabled: isEditable(args.column, args.requestType, args.element) && isCellHaveWidth(parentsUntil(args.element, 'e-rowcell')),
cssClass: this.parent.cssClass ? this.parent.cssClass : null
}, args.column.edit.params));
this.obj.appendTo(args.element);
};
return MaskedTextBoxCellEdit;
}(EditCellBase));
export { MaskedTextBoxCellEdit };