使用JSOM将Web中的所有列表加载为特定的内容类型 [英] Loading all the list in web with specific Content Type Using JSOM
本文介绍了使用JSOM将Web中的所有列表加载为特定的内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用此脚本来获取网站中所有列表的信息,如何修改此脚本以使用特定的基本内容来获取所有列表,请在脚本下方键入
I m using this script to get all the list insible a web site, how can i modify this script to get all the list using a specific base content Type below my script
var siteUrl = '/sites/MyWebsite';
function retrieveAllListProperties() {
var clientContext = new SP.ClientContext(siteUrl);
var oWebsite = clientContext.get_web();
this.collList = oWebsite.get_lists(); // how to specify the content type for the list i want to load???
clientContext.load(collList);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded() {
var listInfo = '';
var listEnumerator = collList.getEnumerator();
while (listEnumerator.moveNext()) {
var oList = listEnumerator.get_current();
listInfo += 'Title: ' + oList.get_title() + '\n';
}
console.log(listInfo);
}
function onQueryFailed(sender, args) {
console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
推荐答案
您好,
Sam
最好的问候,
Lee
这篇关于使用JSOM将Web中的所有列表加载为特定的内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文