v7.3.0
SupportExamplesFree Trial

Print
Feature

Allows printing Grid 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.

This feature will not work properly when Store uses lazyLoad

Usage

const grid = new Grid({
    features : {
        print : true
    }
})

// Opens popup allowing to customize print settings grid.showPrintDialog();

// Simple print grid.print({ columns : grid.columns.map(c => c.id) });

This feature is disabled by default. For info on enabling it, see GridFeatures.

See also

No results

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 : 'portrait'/'landscape'portrait
    PdfExport

    Orientation. Options are portrait and landscape.

  • paperFormat : 'A0'/'A1'/'A2'/'A3'/'A4'+ 3 moreA4
    PdfExport

    Export paper format. Available options are A1...A5, Legal, Letter.

  • rowsRange : 'all'/'visible'all
    PdfExport

    Specifies which rows to export. all for complete set of rows, visible for only rows currently visible.

  • The widget which this plugin is to attach to.

    Has a corresponding runtime client property.

  • Set to false to disable localization of this object.

  • Set to true to align row top to the page top on every exported page. Only applied to multipage export.

  • A config object to apply to the ExportDialog widget.

    Has a corresponding runtime exportDialog property.

  • exportMask : String"Generating pages..."
    PdfExport

    A message to be shown when Export feature is performing export.

  • exportProgressMask : String"Waiting for response from server..."
    PdfExport

    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 @page style with paper size and orientation specified.

  • Set to true to show column headers on every page. This will also set alignRows to true. Only applies to MultiPageVertical exporter.

  • Set to false to 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 request true - stream pages directly to the server null (default) - ask export server for WebSocket support and use it if possible

    Has 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
  • isEvents : Booleantrue
    READONLY
    static
    ADVANCED
    Events
    Identifies an object as an instance of Events class, or subclass thereof.
  • isLocalizable : Booleantrue
    READONLY
    static
    ADVANCED
    Localizable
    Identifies an object as an instance of Localizable class, or subclass thereof.
  • isPrint : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of Print class, or subclass thereof.
  • isPrintMixin : Booleantrue
    READONLY
    static
    ADVANCED
    PrintMixin
    Identifies an object as an instance of PrintMixin class, or subclass thereof.
  • properties : Object
    internal
    static
    PdfExport

    A class property getter for the default values of internal properties for this class.

  • emptyArray : Array
    internal
    READONLY
    PdfExport

    An empty array that can be used as a default value.

  • emptyObject : Object
    internal
    READONLY
    PdfExport

    An empty object that can be used as a default value.

  • isInstancePlugin : Booleantrue
    READONLY
    ADVANCED
    PdfExport
    Identifies an object as an instance of InstancePlugin class, or subclass thereof.
  • isPdfExport : Booleantrue
    READONLY
    ADVANCED
    PdfExport
    Identifies an object as an instance of PdfExport class, or subclass thereof.
  • isPrint : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of Print class, or subclass thereof.
  • config : Object
    READONLY
    ADVANCED
    PdfExport

    Returns a copy of the full configuration which was used to configure this object.

  • isConstructing : Boolean
    READONLY
    ADVANCED
    PdfExport

    This property is set to true before the constructor returns.

  • isDestroying : Boolean
    READONLY
    ADVANCED
    PdfExport

    This property is set to true on entry to the destroy method. It remains on the objects after returning from destroy(). If isDestroyed is true, this property will also be true, so there is no need to test for both (for example, comp.isDestroying || comp.isDestroyed).

  • client : Widget
    READONLY
    ADVANCED
    PdfExport

    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 true if 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 request true - stream pages directly to the server null (default) - ask export server for WebSocket support and use it if possible

    Has 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
  • onClassMixedIn( )
    internal
    static
    PdfExport

    This optional class method is called when a class is mixed in using the mixin() method.

  • initClass( )
    static
    ADVANCED
    PdfExport

    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

  • doDestroy( )
    internal
    Events

    Auto detaches listeners registered from start, if set as detachable

  • once( )
    private
    Events

    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.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class
id: print

Source path

Grid/feature/export/Print.js

Demo

examples/print

Contents