Print
Feature
Allows printing Gantt contents using browser print dialog.
This feature is based on PdfExport with only difference that instead of sending request to a backend it renders content to an IFrame element and requests print dialog for it. For more details about preparing HTML for printing, please refer to the PdfExport docs.
Usage
const gantt = new Gantt({
features : {
print : true
}
})
// Opens popup allowing to customize print settings
gantt.features.print.showPrintDialog();
// Simple print
gantt.features.print.print({
columns : scheduler.columns.map(c => c.id)
});
This feature is disabled by default. For info on enabling it, see GridFeatures.
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Internal listeners, that cannot be removed by the user.
-
Orientation. Options are
portraitandlandscape. -
Export paper format. Available options are A1...A5, Legal, Letter.
-
Exported time span range end. Used with
daterangeconfig of the scheduleRange -
Exported time span range start. Used with
daterangeconfig of the scheduleRange -
Specifies which rows to export.
allfor complete set of rows,visiblefor only rows currently visible. -
Specifies how to export time span.
- completeview - Complete configured time span, from scheduler start date to end date
- currentview - Currently visible time span
- daterange - Use specific date range, provided additionally in config. See rangeStart/ rangeEnd
-
The widget which this plugin is to attach to.
Has a corresponding runtime client property.
-
Set to
falseto disable localization of this object. -
Set to
trueto align row top to the page top on every exported page. Only applied to multipage export. -
A config object to apply to the SchedulerExportDialog widget.
Has a corresponding runtime exportDialog property.
-
A message to be shown when Export feature is performing export.
-
A message to be shown when export is almost done.
-
Config for exporter.
-
exporterType : 'singlepage'/'singlepageunscaled'/'multipage'/'multipagevertical'/Stringsinglepage PdfExport
Type of the exporter to use. Should be one of the configured exporters
-
exporters : Exporter[]["SinglePageExporter","SinglePageUnscaledExporter","MultiPageExporter","MultiPageVerticalExporter"] PdfExport
List of exporter classes to use in export feature
-
When true links are converted to absolute by combining current window location (with replaced origin) with resource link. When false links are converted by combining new origin with resource link (for angular)
-
Defines if printed/exported page should contain
@pagestyle with paper size and orientation specified. -
Set to
trueto show column headers on every page. This will also set alignRows to true. Only applies to MultiPageVertical exporter. -
Set to
falseto not show Toast message on export error. -
When true, export feature will use an iframe and browser's default print dialog, which allows saving as PDF. Content is optimized for chrome/edge to exact page size in the specified orientation and no margins. If you only see grid header or blank pages, try using different scale value in the print dialog NOTE: Not supported in Safari. Print works, but Safari cannot seem to fit content to one page correctly.
-
This config forces exporter to always use rendered column width. Used by Agenda view in Calendar
-
Determines whether to stream exported pages directly to the export server using WebSocket connection to offload client application.
false- use legacy mode which first collected all pages locally and then passed them in a single requesttrue- stream pages directly to the servernull(default) - ask export server for WebSocket support and use it if possibleHas a corresponding runtime webSocketAvailable property.
-
Maximum time in ms to wait for the response over the websocket connection
Has a corresponding runtime webSocketRequestTimeout property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of Events class, or subclass thereof.
-
Identifies an object as an instance of Localizable class, or subclass thereof.
-
Identifies an object as an instance of Print class, or subclass thereof.
-
Identifies an object as an instance of PrintMixin class, or subclass thereof.
-
A class property getter for the default values of internal properties for this class.
-
An empty array that can be used as a default value.
-
An empty object that can be used as a default value.
-
Identifies an object as an instance of InstancePlugin class, or subclass thereof.
-
Identifies an object as an instance of PdfExport class, or subclass thereof.
-
Identifies an object as an instance of Print class, or subclass thereof.
-
Returns a copy of the full configuration which was used to configure this object.
-
This property is set to
truebefore theconstructorreturns. -
This property is set to
trueon entry to the destroy method. It remains on the objects after returning fromdestroy(). If isDestroyed istrue, this property will also betrue, so there is no need to test for both (for example,comp.isDestroying || comp.isDestroyed). -
The Widget which was passed into the constructor, which is the Widget we are providing extra services for.
Has a corresponding client config.
-
Get the global LocaleHelper
-
Get the global LocaleManager
-
When export is started from GUI (ExportDialog), export promise can be accessed via this property.
-
Returns the instantiated export dialog widget as configured by exportDialog
Has a corresponding exportDialog config.
-
This yields
trueif an export/print operation is ongoing. -
Determines whether to stream exported pages directly to the export server using WebSocket connection to offload client application.
false- use legacy mode which first collected all pages locally and then passed them in a single requesttrue- stream pages directly to the servernull(default) - ask export server for WebSocket support and use it if possibleHas a corresponding webSocketAvailable config.
-
Maximum time in ms to wait for the response over the websocket connection
Has a corresponding webSocketRequestTimeout config.
Functions
Functions are methods available for calling on the class-
This optional class method is called when a class is mixed in using the mixin() method.
-
Registers this class type with its Factory
-
Internal function used to hook destroy() calls when using thisObj
-
Internal function used restore hooked destroy() calls when using thisObj
-
Auto detaches listeners registered from start, if set as detachable
-
Internal function used to run a callback function after an event is triggered
-
Removes all listeners registered to this object by the application.
-
This will merge a feature's (subclass of InstancePlugin) keyMap with it's client's keyMap.