all files / actions/ sort.js

100% Statements 29/29
100% Branches 2/2
100% Functions 11/11
100% Lines 29/29
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43   382× 382× 382× 382× 382×   27959×   382×   382× 379×     382×       15×          
define(["require", "exports", "@syncfusion/ej2-treegrid", "@syncfusion/ej2-grids"], function (require, exports, ej2_treegrid_1, ej2_grids_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Sort = (function () {
        function Sort(gantt) {
            this.parent = gantt;
            ej2_treegrid_1.TreeGrid.Inject(ej2_treegrid_1.Sort);
            this.parent.treeGrid.allowSorting = this.parent.allowSorting;
            this.parent.treeGrid.sortSettings = ej2_grids_1.getActualProperties(this.parent.sortSettings);
            this.addEventListener();
        }
        Sort.prototype.getModuleName = function () {
            return 'sort';
        };
        Sort.prototype.addEventListener = function () {
            this.parent.on('updateModel', this.updateModel, this);
        };
        Sort.prototype.removeEventListener = function () {
            if (this.parent.isDestroyed) {
                return;
            }
            this.parent.off('updateModel', this.updateModel);
        };
        Sort.prototype.destroy = function () {
            this.removeEventListener();
        };
        Sort.prototype.sortColumn = function (columnName, direction, isMultiSort) {
            this.parent.treeGrid.sortByColumn(columnName, direction, isMultiSort);
        };
        Sort.prototype.clearSorting = function () {
            this.parent.treeGrid.clearSorting();
        };
        Sort.prototype.updateModel = function () {
            this.parent.sortSettings = this.parent.treeGrid.sortSettings;
        };
        Sort.prototype.removeSortColumn = function (columnName) {
            this.parent.treeGrid.grid.removeSortColumn(columnName);
        };
        return Sort;
    }());
    exports.Sort = Sort;
});