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

Menu datasource: how to access it and add custom properties?

1 Answer 390 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Henrik
Top achievements
Rank 1
Henrik asked on 20 Apr 2017, 01:26 PM

Hi,

I'm using the Kendo UI Menu for Angular 1 to list projects users can access in a solution. Is it possible to use JSON objects received from a WebAPI directly as menuItems or will I have to remap these into simpler objects? In this demo you are using custom attributes, will I be able to access these in the select event (how?)?

Further more, is it possible to access the datasource from another function in my Angular controller? I am currently storing the project ID in localstorage and if I'm able to use JSON objects or custom attributes in MenuItems I'd like to access the datasource so I can retrieve properties/attributes from the MenuItems.

BR,

Henrik

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 24 Apr 2017, 09:29 AM
Hello Henrik,

Kendo UI Menu does not support binding to a remote DataSource. You can initialize it from HTML markup or from JSON data objects. For more information you can check this documentation example, which shows how to use JSON DataSource and how to assign select handler for every item.

On the following Dojo example you will find a simple implementation of the Kendo Menu in AngularJS. I have added a button, which logs in the console the DataSource items from the menu.

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