标签:
获取当前站点(子站点而不是站点集)下的list
var clientContext = new SP.ClientContext.get_current();
var list=clientContext.get_web().get_lists().getByTitle("List名称");
其他子站
var clientContext = new SP.ClientContext(‘站点路径‘);
var list=clientContext.get_web().get_lists().getByTitle("List名称");
var camlQuery = new SP.CamlQuery();
var roles = ["CA ERPCountersign", "CA IBDCountersign"];
var xmlString = "<View><Query></Query></View>";
camlQuery.set_viewXml(xmlString);
var collListItem = List.getItems(camlQuery);
clientContext.load(collListItem);
clientContext.executeQueryAsync(function () {
var listItemInfo = "";
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
$.each(oListItem.get_item(‘字段名‘), function (i, d) {
listItemInfo += d.$2d_1 + ";";
})
}
}, function () {
alert("error!");
});
Sharepoint的javascript客户端对象模型获取其他站点的list
标签:
原文地址:http://www.cnblogs.com/martin-li/p/4398137.html