Kendo (jQuery) context menu does not work when using a filter

0 Answers 7 Views
Menu TreeView
Jason
Top achievements
Rank 1
Jason asked on 02 Sep 2025, 03:36 PM

Hello all,

 

I have been using Kendo for quite a while now. As of recently our team decided to upgrade the Kendo version our software is using. We upgraded from Kendo 2022 to Kendo 2025. This was quite an upgrade, so we spent a lot of time fixing bugs and visual problems. Luckily, we managed to get it all up and running, until today.

Our software uses context menu's. When setting these up we define a target and also a filter within. In the case of the problem we are facing, we are using a context menu for a treeview with items. So we target the treeview, and filter on specific treeview items. That way a context menu will only appear if you specifically right-click an item in the treeview.

Since the upgrade, no context menu appears. Whenever we remove the filter from the context menu options, a context menu does appear. This is not what we are looking for, because we only want to trigger a context menu on treeview items. Hence we need the the filter option. I added a breakpoint in the Kendo source code where the code checks if the target element matches with the given filter in the options. To my surprise, the code continues as expected and calls the "open" method on the context menu. Still, there is no context menu visible. I have tried all sorts of filters, even a star-selector (*), which should match all elements. Even with that, it does not work.

It looks like in both cases (with or without a given filter) the code goes through the sameflow. However, as soon as there is a filter present, no context menu appears.


this.treeViewContextMenu = $("#treeViewContextMenu").kendoContextMenu({
                dataSource: [
                    {text: "Item toevoegen", attr: {action: "addNewItem"}},
                    {text: "Hernoemen", attr: {action: "rename"}},
                    {text: "Verwijderen", attr: {action: "delete"}}
                ],
                target: ".tabstrip-treeview",
                filter: '.k-treeview-leaf-text',
                open: this.onContextMenuOpen.bind(this),
                select: this.onContextMenuSelect.bind(this)
            }).data("kendoContextMenu");

Does any of you guys know what might be wrong? Am I approaching it incorrectly? Thank you!

Neli
Telerik team
commented on 05 Sep 2025, 06:46 AM

Hi Jason,

I tested the described snippet, but on my side the ContextMenu is correctly opened on right click of the TreeView nodes using the latest version. Here is a Dojo example where this is demonstrated - https://dojo.telerik.com/yqXaknFQ

May I ask you to modify the example and send it back to us for a review? This will help us to get a better idea of what might be the cause of the observed issue.

Looking forward to your reply.

Regards,

Neli

No answers yet. Maybe you can help?

Tags
Menu TreeView
Asked by
Jason
Top achievements
Rank 1
Share this question
or