define(["require", "exports", "../base/util", "@syncfusion/ej2-data", "@syncfusion/ej2-dropdowns", "@syncfusion/ej2-base"], function (require, exports, util_1, ej2_data_1, ej2_dropdowns_1, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var BooleanFilterUI = (function () {
function BooleanFilterUI(parent, serviceLocator, filterSettings) {
this.parent = parent;
this.serviceLocator = serviceLocator;
this.filterSettings = filterSettings;
}
BooleanFilterUI.prototype.create = function (args) {
var isForeignColumn = args.column.isForeignColumn();
var dataSource = isForeignColumn ? args.column.dataSource : this.parent.dataSource;
var fields = isForeignColumn ? args.column.foreignKeyValue : args.column.field;
this.elem = ej2_base_1.createElement('input', { className: 'e-flmenu-input', id: 'bool-ui-' + args.column.uid });
args.target.appendChild(this.elem);
this.dialogObj = args.dialogObj;
this.dropInstance = new ej2_dropdowns_1.DropDownList({
dataSource: dataSource instanceof ej2_data_1.DataManager ?
dataSource : new ej2_data_1.DataManager(dataSource),
query: new ej2_data_1.Query().select(fields),
fields: { text: fields, value: fields },
placeholder: args.localizeText.getConstant('SelectValue'),
cssClass: 'e-popup-flmenu',
locale: this.parent.locale,
enableRtl: this.parent.enableRtl,
open: this.openPopup.bind(this),
actionComplete: function (e) {
e.result = ej2_data_1.DataUtil.distinct(e.result, fields, true);
}
});
this.dropInstance.appendTo(this.elem);
};
BooleanFilterUI.prototype.write = function (args) {
var drpuiObj = document.querySelector('#bool-ui-' + args.column.uid).ej2_instances[0];
if (!ej2_base_1.isNullOrUndefined(args.filteredValue)) {
drpuiObj.text = args.filteredValue;
}
};
BooleanFilterUI.prototype.read = function (element, column, filterOptr, filterObj) {
var drpuiObj = document.querySelector('#bool-ui-' + column.uid).ej2_instances[0];
var filterValue = drpuiObj.value;
filterObj.filterByColumn(column.field, filterOptr, filterValue, 'and', false);
};
BooleanFilterUI.prototype.openPopup = function (args) {
util_1.getZIndexCalcualtion(args, this.dialogObj);
};
return BooleanFilterUI;
}());
exports.BooleanFilterUI = BooleanFilterUI;
});
|