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

Set Breadcrumb items programmatically

4 Answers 263 Views
Breadcrumb
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Veteran
Andrey asked on 27 Jan 2020, 02:34 PM

Hi, Dev Team!

At first, really thank you for Breadcrumb!

How i can set items programmatically or bind to dataSource?

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 28 Jan 2020, 07:14 AM

Hello Andrey,

Items could be set programmatically through the items() method:

<script>
    var breadcrumb = $("#breadcrumb").kendoBreadcrumb({

    }).getKendoBreadcrumb();

    breadcrumb.items([
        { type: "rootitem", text: "Home", showText: true, showIcon: false }
    ]);
</script>
I also noticed that there is a small typo in the items API link which I will fix accordingly. However, here is a Dojo example with a working version.

In case you have any additional questions, please let me know.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andrey
Top achievements
Rank 1
Veteran
answered on 28 Jan 2020, 02:19 PM

Hello Dimitar!

Thank you for reply. Actually i mean how i can append new items dynamically? Something like "breadcrumb.items.push({ type: "rootitem", text: "Home", showText: true, showIcon: false })"


0
Accepted
Dimitar
Telerik team
answered on 29 Jan 2020, 08:34 AM

Hello Andrey,

Thank you for the clarification provided.

There is no dedicated method for dynamically adding items in the Breadcrumb. However, this could be easily achieved by pushing the desired item to the items collection and the calling the refresh() method:

breadcrumb.items().push({ type: "item", text: "Inbox", showText: true, showIcon: false });
breadcrumb.refresh();

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andrey
Top achievements
Rank 1
Veteran
answered on 30 Jan 2020, 12:12 PM
Yes, thank you! that exactly what i mean.
Tags
Breadcrumb
Asked by
Andrey
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Andrey
Top achievements
Rank 1
Veteran
Share this question
or