开发者

Can't identify document objects for Context Menus in SharePoint Lists

开发者 https://www.devze.com 2023-01-16 12:41 出处:网络
I\'m trying to use JavaScript to find the context menu items being shown and selected from the lists (such as a document library) in SharePoint. I\'ve tracked down a few different function names withi

I'm trying to use JavaScript to find the context menu items being shown and selected from the lists (such as a document library) in SharePoint. I've tracked down a few different function names within core.js, (such as DispEx() and CMOpt()) but I really am having a hard time following the unhelpful variable name mess.

My understanding is that the context menu has to exist within the DOM somewhere - I just can't find out how to retrieve/reference it.

Thanks in advance - this is driving me 开发者_如何转开发nuts!

EDIT: I've tried traversing all children from onclick="return DispEx(...)" and I'm not getting anything! This is what I've used to capture that info:

' '

function findStuff(){
var something;
$('[onclick*=DispEx]').children().each(function(){
    something = something + this.tagName + '\n';
});
alert(something);

}


It looks like those dom elements might be generated by javascript. Take a look at this article.

Also, you might be able to find the element id's by just searching the dom for text using the contains selector:

$(":contains('context menu item text')").attr('id')


I ended up using an element tracking plug-in to track commonalities between three different installations of SharePoint to get a rough general case. However, I was unable to avoid needed some configuration tailored to the install :(

0

精彩评论

暂无评论...
验证码 换一张
取 消