All Components

DropDownButton Overview

The DropDownButton has the appearance of a button.

When you click on it, the DropDownButton shows a popup list with items.

Basic Usage

The following example demonstrates the DropDownButton in action.

@Component({
    selector: 'my-app',
    template: `
        <div class="example-wrapper">
            <kendo-dropdownbutton [data]="data">
                User Settings
            </kendo-dropdownbutton>
        </div>
    `
})
class AppComponent {
    data: Array<any> = [{
        text: 'My Profile'
    }, {
        text: 'Friend Requests'
    }, {
        text: 'Account Settings'
    }, {
        text: 'Support'
    }, {
        text: 'Log Out'
    }];
}

Features

The DropDownButton delivers the following features:

Events

import { Component } from '@angular/core';

@Component({
    selector: 'my-app',
    template: `
        <kendo-dropdownbutton
            [data]="data"
            (focus)="onFocus()"
            (blur)="onBlur()"
            (close)="onClose()"
            (open)="onOpen()"
            (itemClick)="onItemClick()"
        >
            User Settings
        </kendo-dropdownbutton>
        <event-log title="Event log" [events]="events"></event-log>
    `
})

export class AppComponent {
    public data: Array<any> = [
        { text: 'My Profile' },
        { text: 'Friend Requests' },
        { text: 'Account Settings' },
        { text: 'Support' },
        { text: 'Log Out' }
    ];

    public events: string[] = [];

    public onItemClick(): void {
        this.log("item click");
    }

    public onFocus(): void {
        this.log("focus");
    }

    public onBlur(): void {
        this.log("blur");
    }

    public onOpen(): void {
        this.log("open");
    }

    public onClose(): void {
        this.log("close");
    }

    private log(event: string, arg: any): void {
        this.events.push(`${event}`);
    }
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ButtonsModule } from '@progress/kendo-angular-buttons';
import { AppComponent } from './app.component';
import { EventLogComponent }   from './event-log.component';

@NgModule({
    bootstrap:    [AppComponent],
    declarations: [AppComponent, EventLogComponent],
    imports:      [BrowserModule, BrowserAnimationsModule, ButtonsModule]
})
export class AppModule {}
import { Component, Input } from '@angular/core';

@Component({
  selector: 'event-log',
  template: `
    <div class="example-config">
      <h5>{{ title }}</h5>
      <ul class="event-log">
        <li *ngFor="let event of events.reverse()">{{ event }}</li>
      </ul>
    </div>
  `
})
export class EventLogComponent {
  @Input() title: string;
  @Input() events: string[];
}
import { AppModule } from './app.module';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
In this article