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;
});
|