百家乐开户电话_17300435119(微同)
function addListViewWebPart() {
var context = SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle(‘你的列表标题’);
var view = list.get_views().getByTitle(‘你的视图标题’);
context.load(view);
context.executeQueryAsync(
function() {
var viewGuid = view.get_serverRelativeUrl();
var html = ‘<WebPartPages:ContentWebPart … ViewSelector=”‘ + viewGuid + ‘” />’;
// 使用JavaScript在页面上动态添加Web部件
var allWebParts = document.getElementsByTagName(‘WebPart’);
var container = document.createElement(‘div’);
container.innerHTML = html;
var webPart = container.firstChild;
allWebParts[0].parentNode.insertBefore(webPart, allWebParts[0]);
SP.WebPart.associateWebPartWithDedicatedTemplate(webPart, ”);
},
function(sender, args) {
console.log(‘请求失败:’ + args.get_message());
}
);
}
function addListViewWebPart() {var context = SP.ClientContext.get_current();var web = context.get_web();var list = web.get_lists().getByTitle(‘你的列表标题’);var view = list.get_views().getByTitle(‘你的视图标题’);context.load(view);context.executeQueryAsync(function() {var viewGuid = view.get_serverRelativeUrl();var html = ‘<WebPartPages:ContentWebPart … ViewSelector=”‘ + viewGuid + ‘” />’;// 使用JavaScript在页面上动态添加Web部件var allWebParts = document.getElementsByTagName(‘WebPart’);var container = document.createElement(‘div’);container.innerHTML = html;var webPart = container.firstChild;allWebParts[0].parentNode.insertBefore(webPart, allWebParts[0]);SP.WebPart.associateWebPartWithDedicatedTemplate(webPart, ”);},function(sender, args) {console.log(‘请求失败:’ + args.get_message());});} Read More