I'm trying to create the submenu thru an ajax call sending the parent element as a parameter to get the submenu items on the open event but is not working.
Has anyone have an idea how this can be done?
Thanks
I'm trying to create the submenu thru an ajax call sending the parent element as a parameter to get the submenu items on the open event but is not working.
Has anyone have an idea how this can be done?
Thanks
Steve Greene
On
The append method of the menu takes a list of items you want to append and a target (default is root). So I assume by your ajax reference you are fetching the submenu from the server/database. So convert that to the array and pass it in:
$.ajax({
type: "POST",
... etc.
success: function (menuData) {
... compose your submenu
var menu = $("#menu").kendoMenu().data("kendoMenu");
menu.append(submenuarray, $("#targetMenuItem"));
...
});
Here is a simplified DOJO example without the database part.
If you want this to occur when the menu is opened, add the Open event.
Copyright © 2021 Jogjafile Inc.
You can utilize the append method like
where
i tried it myself, here is the example
a bit of explanation of the example :
ps : there is still 1 issue if you select the menu twice it will append the submenu twice, you need to handle this issue