Context menu getSelectedId returning null value

I am trying to get the context menu’s selected menuItem id using below line of code :
var id = $$(“dtContextMenu”).getSelectedId(true);

It always returning the null value even after I selected the Menu item from the context menu. How can I get the selected Menu item id from the context menu.

By default, a menu doesn’t have selection at all.
When you clicking on a menu item, menu doesn’t select the clicked item, it just closes self. If you are using the related event handlers to catch the menu item click, you will receive the ID of clicked item as a parameter of event call.

http://docs.webix.com/api__link__ui.contextmenu_onmenuitemclick_event.html

How can I get Highlighted Menu item id??

There is no API for such use-case. If you have an event object you can use the .locate API to get ID of item in event’s area.