sharepoint JQ获取List列表的值
2017-05-22 18:14
281 查看
<script type="text/javascript">
function getlistitem()
{
var mycontext=new SP.ClientContext();
var mysite=mycontext.get_web();
var query = new SP.CamlQuery();
query.set_viewXml("<View><Query></Query></View>");
var mylist=mysite.get_lists().getByTitle('test');
myitem= mylist.getItems(query);
mycontext.load(myitem);
mycontext.executeQueryAsync(Function.createDelegate(this,this.getsuccessed),Function.createDelegate
(this,this.getfailed));
}
function getsuccessed()
{
var str="";
var gh="";
var listsE=myitem.getEnumerator();
while(listsE.moveNext())
{
gh+=listsE.get_current().get_item("_x5de5__x53f7_")+"<br>";
str+=listsE.get_current().get_item("Title")+"<br>";
}
document.getElementById("lists").innerHTML=gh;
}
function getfailed(sender,args)
{
alert("failed~!");
}
</script>
<div><input value="get2" type="button" onclick="getlistitem()"/></div>
<div id="lists"></div>
<div id="listg"></div>
function getlistitem()
{
var mycontext=new SP.ClientContext();
var mysite=mycontext.get_web();
var query = new SP.CamlQuery();
query.set_viewXml("<View><Query></Query></View>");
var mylist=mysite.get_lists().getByTitle('test');
myitem= mylist.getItems(query);
mycontext.load(myitem);
mycontext.executeQueryAsync(Function.createDelegate(this,this.getsuccessed),Function.createDelegate
(this,this.getfailed));
}
function getsuccessed()
{
var str="";
var gh="";
var listsE=myitem.getEnumerator();
while(listsE.moveNext())
{
gh+=listsE.get_current().get_item("_x5de5__x53f7_")+"<br>";
str+=listsE.get_current().get_item("Title")+"<br>";
}
document.getElementById("lists").innerHTML=gh;
}
function getfailed(sender,args)
{
alert("failed~!");
}
</script>
<div><input value="get2" type="button" onclick="getlistitem()"/></div>
<div id="lists"></div>
<div id="listg"></div>
相关文章推荐
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- 如何使用dac获取sharepoint list的数据
- jsom sharepoint 2010 循环获取多个list的item值
- 利用InfoPath实现SharePoint Server 2013列表的级联选择(Cascading Drop Down List)
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- [10月15日的脚本] 从Microsoft SharePoint Server 2010中获取签出文件列表
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- 转:C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- Sharepoint 复制备份系列--使用编程方式复制列表1(Copy a SharePoint List Programmatically)
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- SharePoint显示来自相同网站集另一个站点的列表 Display SharePoint list from another site
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- Sharepoint 复制备份系列--使用编程方式复制列表2(Copy a SharePoint List or site ,web Programmatically)
- SPListTemplateType 枚举 (Microsoft.SharePoint) 创建列表时的ListTemplate Type属性
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- 彻底搞懂SharePoint List Threshold(列表阈值)
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据