This is a migrated thread and some comments may be shown as answers.

Generic Button Group

1 Answer 278 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 22 Dec 2017, 08:57 AM

Is it possible to create a dynamic ButtonGroup like this?

 

<kendo-buttongroup selection="single">
    <div *ngFor="let label of labels" >

<button kendoButton [togglable]="true" [icon]="" >label</button>
</div>
</kendo-buttongroup>

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 22 Dec 2017, 09:43 AM
Hi Stefan,

You can put the *ngFor structural directive on the button element, and generate a button for each item in the respective collection, e.g.:

https://plnkr.co/edit/Q3p8aem4BWHw4GpInL79?p=preview

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Stefan
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or