Expand nth level sub menu in fixed position n button click

How to expand and show nth level menu in fixed position on button click? Please let us know

Please refer attached file for details

Attachment: Menu_open_7c4a66d6.zip

3 Replies 1 reply marked as answer

SD Saranya Dhayalan Syncfusion Team July 2, 2020 11:58 AM UTC

Hi Mahesh, 
 
Thank you for contacting Syncfusion support 
 
We have checked your reported query , We would like to let you know that you can use the ContextMenu component fulfilled your reported requirement. In the below code snippet, you can open the contextmenu by using open method. Please find the below code snippet: 
 
 
@Html.EJS().Button("button").Content("DC").Render() 
@Html.EJS().ContextMenu("contextmenu").Items((IEnumerable<object>)ViewBag.menuItems).Render() 
 
<script> 
    document.addEventListener("DOMContentLoaded", function () { 
        document.getElementById('button').onclick = function () { 
            ej.base.getComponent(document.getElementById("contextmenu"), "contextmenu").open(60, 20); 
        } 
    }); 
 
</script> 
 
 
 
Could you please check the above code snippet and let us know whether this is fulfilling your requirement? 
 
Regards, 
Saranya D 



MM Mahesh Machina July 2, 2020 12:37 PM UTC

We are trying to do this in Menu bar control.

Using context menu is not ideal solution for us


SD Saranya Dhayalan Syncfusion Team July 5, 2020 10:40 AM UTC

Hi Mahesh,  
 
We would like to let you know that currently your provided requirement is not feasible in the Menu component that’s why we have suggested to use context menu. And you mentioned that header will be removed for your case. So, you can create context menu and open it whenever you want by using the instance. Whenever you want the sub menu items you can create by using the context menu. Please check this and get back to us if you need further assistance on this. 
 
Regards, 
Saranya D 


Marked as answer
Loader.
Up arrow icon