-1
獲取URL我使用下面的JavaScript代碼來獲得在SharePoint 2013的所有列表的頭銜,我怎麼能適應這個返回每個列表的網址呢?的SharePoint 2013 - 的JavaScript從列表
我已經厭倦了這一點,但它不工作:
//listUrl = oList.get_url();
//console.log(listUrl);
代碼:
function retrieveAllListProperties() {
var clientContext = new SP.ClientContext('/StrategicProjectOffice');
var oWebsite = clientContext.get_web();
this.collList = oWebsite.get_lists();
clientContext.load(collList);
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQuerySucceeded)
);
}
function onQuerySucceeded() {
var listTitle = '';
var listEnumerator = collList.getEnumerator();
while (listEnumerator.moveNext()) {
var oList = listEnumerator.get_current();
listTitle = oList.get_title();
//listUrl = oList.get_url();
//console.log(listUrl);
if (listTitle.indexOf("SPO") >= 0) {
getItemsFromView(listTitle, "All Tasks");
}
}
}