Skip to content

Please add an example for a context menu button/icon #12

@elnicko

Description

@elnicko

As per gitter chat room, it would be nice if next to the drop down buttons we had the option to actually trigger a DropDownMenu from a normal button or icon. This allows for more styling options.

The following code compiles and works as expected for a "Kebap-Menu":

element.appendChild(Icons.ALL.dots_vertical_mdi()
                .clickable()
                .apply(self -> {
                    DropDownMenu dropDownMenu = DropDownMenu.create(self);
                    dropDownMenu.appendChild(DropdownAction.create("value 1")
                            .addClickListener(evt -> {})
                    );
                    dropDownMenu.appendChild(DropdownAction.create("value 2")
                            .addClickListener(evt -> {})
                    );

                    self.addClickListener(evt -> {
                        dropDownMenu.open();
                        evt.stopPropagation();
                    });

                }).element());

Please add this to the demo application

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions