alfresco-ng2-components/docs/core/buttons-menu.component.md
Andy Stark 28ba09897e [ADF-2764] Added new type linker features and applied them to core docs (#3442)
* [ADF-2764] Added basic support for composite and external types

* [ADF-2764] Added new type linker features and applied to core docs
2018-06-06 13:21:31 +02:00

2.1 KiB

Added, Status, Last reviewed
Added Status Last reviewed
v2.4.0 Active 2018-04-24

Buttons Menu Component

Displays buttons on a responsive menu.

adf-buttons-menu-desktop

Basic Usage

<adf-buttons-action-menu
    [buttons]="buttons">
</adf-buttons-action-menu>  

Class members

Properties

Name Type Default value Description
buttons MenuButton[] Array of buttons that defines the menu.

Details

This component shows buttons on a responsive menu. The display of the menu changes to fit the screen size of the device:

Desktop view of the menu

adf-buttons-menu-desktop

Mobile view of the menu

adf-buttons-menu-mobile

The buttons property contains an array of MenuButton instances that define the label and appearance of each button along with a handler function to implement its action:

buttons: MenuButton[] = [];

 setButtons() {
        this.buttons = [
            new MenuButton({
                label: 'Settings',
                icon: 'settings',
                handler: this.settings.bind(this)
            }),
            new MenuButton({
                label: 'Delete',
                icon: 'delete',
                handler: this.deleteItem.bind(this, this.reportId),
                id: 'delete-button'
            }),
            new MenuButton({
                label: 'Export',
                icon: 'file_download',
                handler: this.exportItem.bind(this),
                id: 'export-button',
                isVisible: this.isItemValid.bind(this)
            }),
            new MenuButton({
                label: 'Save',
                icon: 'save',
                handler: this.saveItem.bind(this),
                id: 'save-button',
                isVisible: this.isItemValid.bind(this)
            })
        ];

See also