SharePoint 2010 question here. I have a document library with a number of documents, and I want to add an entry to the list item context menu (the dropdown menu that contains the "View properties"/"Edit properties" etc). I got the impression that this could be done by adding a content editor web part containing the following JavaScript:
<script language="javascript">
function Custom_AddDocLibMenuItems(m, ctx)
{
var strDisplayText = "Custom menu item";
var strAction = "alert('Yo')";
var strImagePath = "";
// Add our new menu item
CAMOpt(m, strDisplayText, strAction, strImagePath);
// add a separator to the menu
CAMSep(m);
// false means that the standard menu items should also be rendered
return false;
}
</script>
...as per Link. This code adds a new context menu item, as expected. However, I need the context of the item which was clicked in order to access a specific column of the list item. The end goal is to provide a custom filter URL to a different list which is based on the selected item.
The context information is supposed to be available through the itemTable object. But for some reason, this item is not available either through the Custom_AddDocLibMenuItems body or strAction. Any ideas?