3
我需要阅读“Top Nav”,“Children Nodes”并检查每个节点是否可见。SP.NavigationNode.get_isVisible()被破坏?
我正在使用JSOM来完成此操作。除了get_isVisible()函数之外,一切工作都很好。它总是返回true。 MSDN:http://msdn.microsoft.com/en-us/library/office/jj246297.aspx
我在2013年的一个发布网站,我知道一些项目是隐藏的。 (我的网页和背景的这个片段之外定义)
var visParents = [], visChildren = [];
var topNodes = web.get_navigation().get_topNavigationBar();
context.load(topNodes);
context.executeQueryAsync(onQuerySucceeded, onQueryFailed)
function onQuerySucceeded() {
var nodeInfo = '';
var nodeEnumerator = topNodes.getEnumerator();
while (nodeEnumerator.moveNext()) {
var node = nodeEnumerator.get_current();
nodeInfo += node.get_title() + '\n';
if (node.get_isVisible())
visParents.push(node);
}
console.log("Current nodes: \n\n" + nodeInfo);
console.log("Visible Parents", visParents)
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
它不取任何东西,虽然我有一些导航的项目为隐藏。任何线索? –