Hello.
Easy one (I think, even though I can´t find a way): how do I make a context menu appear for a toolbar button (when clicking on the little arrow)?
Marco
Hello.
Easy one (I think, even though I can´t find a way): how do I make a context menu appear for a toolbar button (when clicking on the little arrow)?
Marco
Hi Marco
You set the ContextmenuId="YourContextMenuID" on your button.
Then you have your context menu like this:
<dw:ContextMenu ID="YourContextMenuID" runat="server"> <dw:ContextMenuButton ID="ContextmenuButton9" runat="server" Divide="None" ImagePath="/Admin/Images/Ribbon/Icons/Small/line-chart.png" Text="Dag" OnClientClick="report('PageviewsDay');"> </dw:ContextMenuButton> <dw:ContextMenuButton ID="ContextmenuButton7" runat="server" Divide="None" ImagePath="/Admin/Images/Ribbon/Icons/Small/line-chart.png" Text="Uge" OnClientClick="report('PageviewsWeek');"> </dw:ContextMenuButton> <dw:ContextMenuButton ID="ContextmenuButton8" runat="server" Divide="None" ImagePath="/Admin/Images/Ribbon/Icons/Small/line-chart.png" Text="Måned" OnClientClick="report('PageviewsMonth');"> </dw:ContextMenuButton> </dw:ContextMenu>
Hi Marco,
Take a look at my article series on building Admin interfaces. Part 2 shows an example of this: http://devierkoeden.com/articles/building-dynamicweb-module-admin-interfaces-2-using-the-ribbon-ui-introduction.aspx (in the section RibbonBarButton).
Hope this helps,
Imar
Hello.
ToolbarButton does not have a ContextMenuId property. Or am I missing something?
Marco
You are right. That property is on ribbon bar buttons.
You need to set the clientclick property to open a context menu:
ContextMenu.show(e, 'YourContextMenuID', '', '', 'BottomLeft', document.getElementById('idOfYourButton'));
And set ShowOptions to true for the arrow to appear?
Imar
Yes, ShowOptions was set, it was just the javascript that I tried first time was not correct.
Thanks for the help.
You must be logged in to post in the forum