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

Adding K Icon To Menu Button

3 Answers 523 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Cody
Top achievements
Rank 1
Cody asked on 28 Jul 2020, 12:25 AM

Afternoon

 

Using Package Telerik.UI.for.AspNet.Core(2020.2.617)

 

Goal: 

I want to switch Kendo Menu to use k-i-menu rather than font awsome icon.

 

Problem

It is always blank when i reference the k-i-menu. This is because it adds k-sprite into the span it generates and that seems to cause the issues

e.g. <span class="k-sprite k-icon k-i-menu k-icon-32"></span>

Example Code

<span class="k-icon k-i-menu k-icon-32"></span> <-- this shows bars
<div style="padding-right: 5px" class="k-content">
    @(Html.Kendo().Menu().Name("NavMenu").Items(items =>
    {items.Add()
            .Items(innerChilderen =>
            {
                innerChilderen.Add().Text("Reports").Url("/Something");
            }).SpriteCssClasses("k-icon k-i-menu k-icon-32");  <--- this is blank
    }))
</div>

 

I assumed it would be an easy switch since it was already working with font awesome. Not sure if i'm missing something as far as using the kendo icons with this menu. Looking forward to your thoughts.

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 30 Jul 2020, 02:11 PM

Hello Cody,

The Encoded option can be utilized to add a font icon to the Menu items as demonstrated in this HowTo article:

I hope this helps. In case you have any additional questions, please let me know.

Regards,
Dimitar
Progress Telerik

0
Cody
Top achievements
Rank 1
answered on 31 Jul 2020, 08:46 PM
This article you gave me does show the k icon now but now the menu animation is no longer working using this method. Am i missing something.  I changed my SpriteCssClassesto to Encode(false).Text(<span class=\"k-icon k-i-menu k-icon-32\"></span>) instead
0
Dimitar
Telerik team
answered on 03 Aug 2020, 05:19 AM

Hello Cody,

I am attaching an ASP.NET Core solution where I have added a simple Menu with a configured icon (as demonstrated in the Knowledge Base article). With it, the Menu animations is correctly being executed when the nested list is opened.

May I ask you to examine the sample and let me know if I am missing something?

Regards,
Dimitar
Progress Telerik

Tags
Menu
Asked by
Cody
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Cody
Top achievements
Rank 1
Share this question
or