[]
        
(Showing Draft Content)

ReportViewer.Toolbar

Class: Toolbar

ReportViewer.Toolbar

Viewer toolbar.

Table of contents

Methods

Methods

addItem

addItem(item): void

Adds a new item to the toolbar.

var pdfExportButton = {
    key: '$pdfExportButtonKey',
    iconCssClass: 'mdi mdi-file-pdf',
    enabled: true,
    action: function(item) {
        console.log('Export to PDF function works here');
    },
    onUpdate: function(arg, item) {
        console.log('Something in viewer was updated, check/update button state here');
    }
};
viewer.toolbar.addItem(pdfExportButton);

Parameters

Name Type Description
item ToolbarItem An item to be added.

Returns

void

Defined in

node_modules/@grapecity/ar-js-viewer/dist/ar-js-viewer.d.ts:604


getDefaultToolbarItems

getDefaultToolbarItems(): string[]

Gets the list of default toolbar items.

Returns

string[]

Defined in

node_modules/@grapecity/ar-js-viewer/dist/ar-js-viewer.d.ts:628


removeItem

removeItem(key): void

Removes a toolbar item.

Parameters

Name Type Description
key string The toolbar item key, as it was specified in the addItem parameters.

Returns

void

Defined in

node_modules/@grapecity/ar-js-viewer/dist/ar-js-viewer.d.ts:614


updateItem

updateItem(key, itemUpdate?): void

Updates a previously added toolbar item.

Parameters

Name Type Description
key string the toolbar item key, as it was specified in the addItem parameters.
itemUpdate? Partial<ToolbarItem> New toolbar item settings.

Returns

void

Defined in

node_modules/@grapecity/ar-js-viewer/dist/ar-js-viewer.d.ts:610


updateLayout

updateLayout(layout): void

Defines the toolbar items layout (order and visibility) for different view modes. A parameter is an object with default, full-screen, mobile mode properties (each property is an array of items to be shown in specific views). Setting to default will only affect all modes (full-screen, mobile) if they are not specified externally.

viewer.toolbar.addItem(pdfExportButton); //now you want to remove everything except pdfExportButton and the navigation block.
viewer.toolbar.updateLayout({default: ['$pdfExportButtonKey', '$navigation']});

will create a toolbar with the export button and the "navigation" block.

Parameters

Name Type
layout ToolbarLayout

Returns

void

Defined in

node_modules/@grapecity/ar-js-viewer/dist/ar-js-viewer.d.ts:626