PDA

View Full Version : [CLOSED] How do you reference the shortcut from ShortcutContextMenu



AaronDev
Apr 16, 2015, 11:05 AM
I'm having trouble trying to reference the desktop module right clicked on when using ShortcutContextMenu. I want the user to have the ability to open the link in a new tab as opposed to a window. I've tried going through the item and event in the listener but they reference the menu which is a child of the desktop so I can't navigate to the shortcut. Any assistance would be appreciated.



Html.X().Desktop()
.ID("DesktopMain")
.Listeners(l =>
{
l.Ready.BroadcastOnBus = "App.Desktop.ready";
})
.DesktopConfig(
Html.X().DesktopConfig()
.Wallpaper("~/Content/wallpapers/blue.jpg")
.ShortcutDragSelector(true)
.ShortcutDefaults(defaults =>
{
defaults.IconCls = "x-default-shortcut";
})
.ShortcutContextMenu(
Html.X().Menu().ID("DesktopModuleContext").Items(
Html.X().MenuItem().Text("Open in New Tab").Listeners(x=>x.Click.Fn = "shortcutContextMenuClick")
)
)
)

Daniil
Apr 16, 2015, 9:11 PM
Hi @AaronDev,

Please use:

item.parentMenu.module.shortcut

AaronDev
Apr 16, 2015, 10:00 PM
Hi Daniil

I missed module in parent menu. From this I was able to get the window and loader url to open in a new tab. Many thanks for the help!