@syncfusion/ej2-grids
Version:
Feature-rich JavaScript datagrid (datatable) control with built-in support for editing, filtering, grouping, paging, sorting, and exporting to Excel.
45 lines (44 loc) • 1.98 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, getValue } from '@syncfusion/ej2-base';
import { MultiSelect } from '@syncfusion/ej2-dropdowns';
import { getComplexFieldID } from '../base/util';
import { EditCellBase } from './edit-cell-base';
/**
* `MultiSelectEditCell` is used to handle multiselect dropdown cell type editing.
*
* @hidden
*/
var MultiSelectEditCell = /** @class */ (function (_super) {
__extends(MultiSelectEditCell, _super);
function MultiSelectEditCell() {
return _super !== null && _super.apply(this, arguments) || this;
}
MultiSelectEditCell.prototype.write = function (args) {
this.column = args.column;
var isInline = this.parent.editSettings.mode !== 'Dialog';
this.obj = new MultiSelect(extend({
fields: { text: args.column.field, value: args.column.field },
value: getValue(args.column.field, args.rowData),
enableRtl: this.parent.enableRtl,
placeholder: isInline ? '' : args.column.headerText, popupHeight: '200px',
floatLabelType: isInline ? 'Never' : 'Always',
cssClass: this.parent.cssClass ? this.parent.cssClass : null
}, args.column.edit.params));
this.obj.appendTo(args.element);
args.element.setAttribute('name', getComplexFieldID(args.column.field));
};
return MultiSelectEditCell;
}(EditCellBase));
export { MultiSelectEditCell };