Context Menu item not programmatically

1 Answer 61 Views
Menu
Ken
Top achievements
Rank 1
Ken asked on 24 Jun 2022, 10:26 AM

Currently changing projects over to core and the wrapper for context menus appears to be behaving differently:-

We initially add menu items disabled and then enable them as required in JS  functions once the applicability of the menu items has been determined.

e.g.

.Items(items =>
{
   items.Add().Text("Complete")
              .HtmlAttributes(new { id = "CompleteID", title = "Complete" })
              .Enabled(false);
}


function EnableMenu(canComplete)
{
   var menu = $("#@Model.HtmlID").data("kendoContextMenu");

   menu.enable("#CompleteID", canComplete);
}

This code works fine in the 2020 version of Kendo UI for ASP.NET MVC but not in the ASP.NET Core product.

The work around appears to be just to remove the .Enable(false) when creating the menu items and then the programmatic enabling/disabling works fine.

I couldn't see any documentation that indicated a change in behaviour so wanted to know if this an intentional change or a possible bug?

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Aleksandar
Telerik team
answered on 29 Jun 2022, 07:54 AM

Hi Ken,

I have investigated the reported behavior and indeed the issue is on our end. I have logged an item on it and you can review it here:

https://github.com/telerik/kendo-ui-core/issues/6899

As a workaround I can propose manually removing the k-state-disabled class:

$("#CompleteID").removeClass("k-state-disabled");

Let me know if this works for you.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Menu
Asked by
Ken
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or