Create a popup menu in Sharepoint / using SP.UI.PopoutMenu

I would like to create a popup menu with javascript in sharepoint, for example, when you click on the first item in the document library:

enter image description here

I think it should be possible to use SP.UI.PopoutMenu , but the MSDN documentation is poorer on this element and cannot find any tutorial on how to use it.

If I just try to open it, nothing will happen:

var anchorId = 'myAnchorId', menuId = 'myMenuDivId', iconId = '', anchorOpenCss = '', textDirection = 'ltr', closeIconUrl = '', isClustered = false, x = 500, y = 500, height = 500, width = 500; SP.UI.PopoutMenu.createPopoutMenuInstanceAndLaunch(anchorId, menuId, iconId, anchorOpenCss, textDirection, closeIconUrl, isClustered, x, y, height, width); 

Any ideas?

PS: I do not want to expand the document library menu, I want to create my own pop-up menu!

+4
source share
2 answers

Okay, I can be late for the party, but I got it in SharePoint 2013. There is still no real documentation that can be found on the front panel of popoutmenu, but messing around with the back-end version i, everything is reconstructed :)

Disclaimer: I have not tested all the features using this PopoutMenu, I am not sure that the elements below should be in the specified order with the indicated tags, I am almost sure that they actually do not exist, and you can have them in any other tags, classes. But do not take my word for it.

In this configuration, everything looks good.

 <a id="anchorID"> Cool Test bro </a> <div class="ms-popoutMenu ms-breadcrumb-menu" id="menuID" style="display:none"> Content and ... <div> Divs and <a href="http://www.google.com">And Links</a> </div> </div> <script type="text/javascript"> var menu = new SP.UI.PopoutMenu("anchorID", "menuID", "", "", "ltr", "", false); menu.launchMenu(); </script> 
+3
source

I have never used a PopoutMenu object before, but what you also specify is the context menu or the Edit Control Block (ECB) menu. I tried to come up with a working sample for PopoutMenu, but you're right, it's hard to use. I found this article on using the ecb custom menu in gridview gridpoint if that helps: http://blogs.msdn.com/b/powlo/archive/2007/02/25/displaying-custom-data-through-sharepoint-lists -using-spgridview-and-spmenufield.aspx

0
source

All Articles