[]
        
(Showing Draft Content)

ReportViewer.Toolbar

Interface: Toolbar

ReportViewer.Toolbar

Defines the contract for the viewer toolbar.

example

const toolbar = {} as Toolbar;
toolbar.getDefaultToolbarItems();

Table of contents

Methods

Methods

addItem

addItem<Item>(item): void

Adds a toolbar item.

example

const toolbar = {} as Toolbar;
toolbar.addItem({ key: 'print' } as ToolbarControl);

Type parameters

Name Type
Item extends Without<ToolbarItemButton, ToolbarItemDropdown> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { items: DropdownItem[] ; selectedKey?: string } | Without<ToolbarItemDropdown, ToolbarItemButton> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { checked?: boolean } = Without<ToolbarItemButton, ToolbarItemDropdown> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { items: DropdownItem[] ; selectedKey?: string } | Without<ToolbarItemDropdown, ToolbarItemButton> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { checked?: boolean }

Parameters

Name Type Description
item Item The toolbar item to add.

Returns

void


getDefaultToolbarItems

getDefaultToolbarItems(groupName?): string[]

Gets the default toolbar items.

example

const toolbar = {} as Toolbar;
const items = toolbar.getDefaultToolbarItems();

Parameters

Name Type Description
groupName? string The optional group name to filter items.

Returns

string[]

The list of toolbar item keys.


removeItem

removeItem(key): void

Removes a toolbar item.

example

const toolbar = {} as Toolbar;
toolbar.removeItem('print');

Parameters

Name Type Description
key string The toolbar item key.

Returns

void


updateItem

updateItem<Item>(key, itemUpdate?): void

Updates a toolbar item.

example

const toolbar = {} as Toolbar;
toolbar.updateItem('print', { visible: false });

Type parameters

Name Type
Item extends Without<ToolbarItemButton, ToolbarItemDropdown> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { items: DropdownItem[] ; selectedKey?: string } | Without<ToolbarItemDropdown, ToolbarItemButton> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { checked?: boolean } = Without<ToolbarItemButton, ToolbarItemDropdown> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { items: DropdownItem[] ; selectedKey?: string } | Without<ToolbarItemDropdown, ToolbarItemButton> & { enabled?: boolean ; icon?: Icon ; iconCssClass?: string ; key: string ; text?: string ; title?: string ; action?: (curr?: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> ; onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => void | Partial<ToolbarItemBase<T>> } & { checked?: boolean }

Parameters

Name Type Description
key string The toolbar item key.
itemUpdate? Partial<Item> The toolbar item update payload.

Returns

void


updateLayout

updateLayout(layout): void

Updates the toolbar layout for different view modes.

example

const toolbar = {} as Toolbar;
toolbar.updateLayout({ default: ['print', 'search'] });

Parameters

Name Type Description
layout ToolbarLayout The layout descriptor for toolbar items.

Returns

void