all files / treegrid/actions/ print.js

100% Statements 26/26
100% Branches 0/0
100% Functions 9/9
100% Lines 26/26
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   625× 625× 625×   11395×   625×                
define(["require", "exports", "../base/constant", "@syncfusion/ej2-grids", "@syncfusion/ej2-base"], function (require, exports, events, ej2_grids_1, ej2_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Print = (function () {
        function Print(parent) {
            this.parent = parent;
            ej2_grids_1.Grid.Inject(ej2_grids_1.Print);
            this.addEventListener();
        }
        Print.prototype.getModuleName = function () {
            return 'print';
        };
        Print.prototype.addEventListener = function () {
            this.parent.grid.on(events.printGridInit, this.printTreeGrid, this);
        };
        Print.prototype.removeEventListener = function () {
            this.parent.grid.off(events.printGridInit, this.printTreeGrid);
        };
        Print.prototype.printTreeGrid = function (printGrid) {
            var grid = ej2_grids_1.getObject('printgrid', printGrid);
            var gridElement = ej2_grids_1.getObject('element', printGrid);
            grid.addEventListener(events.queryCellInfo, this.parent.grid.queryCellInfo);
            grid.addEventListener(events.rowDataBound, this.parent.grid.rowDataBound);
            grid.addEventListener(events.beforeDataBound, this.parent.grid.beforeDataBound);
            ej2_base_1.addClass([gridElement], 'e-treegrid');
        };
        Print.prototype.print = function () {
            this.parent.grid.print();
        };
        Print.prototype.destroy = function () {
            this.removeEventListener();
        };
        return Print;
    }());
    exports.Print = Print;
});