How to Call SharePoint 2013 API Service to Query The Lists
How to Call SharePoint 2013 API
In SharePoint 2013, we can query the list by it owner service, then dynamic load the info of the list items to render in client.
Here is the require, dynamic load the info about the list named link and show to the page in datail.
Here is my steps:
1. Create a link list named "Links", and create a column named "Category", the column is use for category the links, and filter the items. the add some items.
2. Edit the page that you want to show the Links list items. and add the webpart named Script Edittor to store the js code. then edit the webpart and add the js code into the webpart.
Here is the code:
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
</script>
$(document).ready(function () {
ExecuteOrDelayUntilScriptLoaded(getLinksInfo, "sp.js");
});
function getLinksInfo() { var requestUri = "http://dev-sp"+ "/_api/Web/Lists/getByTitle('Links')/items";
var ulIcons = $("#test"); $.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
success: function (data) { var items = "";
$.each(data.d.results, function (index) {
switch ($(this).attr("Category")) {
case "Operations":
items += "<li><a href='mailto:" + $(this)[0].URL.Url+ "'>" + $(this)[0].URL.Description + " - Operation" + "</a></li>"
break;
case "Marketing":
items += "<li><a href='" + $(this)[0].URL.Url + "'>" + $(this)[0].URL.Description + " - Markrting" + "</a></li>"
break;
} }); if (items != "") {
ulIcons.html("");
ulIcons.html(items);
}
},
error: function (e) {
alert("Failed to get Escalations Icons!");
}
});
} </script>
3. Clicke "Ok" abdou the script webpart and save the page. It wiil show the result
How to Call SharePoint 2013 API Service to Query The Lists的更多相关文章
- SharePoint 2013 - REST Service
0. SharePoint 2013使用_api来标识出 REST SERVICE,REST Service其实是 client.svc web service的一部分,但为了简化 REST URI的 ...
- SharePoint 2013 安装 Service Pack 1
Problem 当迁移SharePoint 的时候,执行Move-SPSite 命令,将指定的Site Collection移动到目标内容数据库中时,提示以下错误:Cannot complete th ...
- SharePoint REST api
http://msdn.microsoft.com/en-us/magazine/dn198245.aspx Understanding and Using the SharePoint 2013 R ...
- 修复SharePoint 2013 Search 拓扑错误
Problem 当创建和配置SharePoint 2013 Search Service Application成功之后,进入详细配置页后,在Search Application Topology节点 ...
- SharePoint 2013中的爬网最佳做法
了解在 SharePoint Server 2013 中爬网的最佳做法 搜索系统对内容进行爬网,以构建一个用户可以对其运行搜索查询的搜索索引.本文包含有关如何最有效地管理爬网的建议. 本文内容: 使用 ...
- SharePoint 2013 APP 开发示例 (六)服务端跨域访问 Web Service (REST API)
上个示例(SharePoint 2013 APP 开发示例 (五)跨域访问 Web Service (REST API))是基于JavaScript,运行在web browser内去访问REST AP ...
- SharePoint 2013 APP 开发示例 (五)跨域访问 Web Service (REST API)
虽然 JQuery 也能通过授权header实现跨域, 但SharePoint 提供了更简单的方法,它被实现在SP.RequestExecutor里 .它能访问跨域的服务包括REST AP ...
- SharePoint 2013 Search REST API 使用示例
前言:在SharePoint2013中,提供Search REST service搜索服务,你可以在自己的客户端搜索方法或者移动应用程序中使用,该服务支持REST web request.你可以使用K ...
- 在 SharePoint 2013 中选择正确的 API 集
决定使用哪个 API 集的因素 您可以在多个 API 集中选择一个来访问 SharePoint 2013 平台.您使用哪一个 API 集取决于以下因素: 应用程序的类型. 可能的类型包括但不限于以 ...
随机推荐
- MFC重载关闭按钮
首先介绍一下WindowProc函数. 函数功能:该函数是一个应用程序定义的函数.它处理发送给窗口的消息.WNDPROC类型定义了一个指向该回调函数的指针.WindowProc是用于应用程序定义函数的 ...
- spring security method security
参考 Spring Security 官方文档 http://www.concretepage.com/spring/spring-security/preauthorize-postauthoriz ...
- Android开发--布局
一:LinearLayout 1.线性布局,这个东西,从外框上可以理解为一个div,他首先是一个一个从上往下罗列在屏幕上.每一个LinearLayout里面又可分为垂直布局(android:orie ...
- Eclipse 和 HSQLDB: 将关系数据库服务器嵌入到 Eclipse 中,第 2 部分
HSQLDB 开发者角色 对 HSQLDB 与 Eclipse 工作台的集成感兴趣的开发者可以很容易地被分为两类: 客户机开发者,他们只是用 HSQLDB 来存储数据. 引擎开发者,他们通过添加新的标 ...
- android自定义圆形图片和遇到的问题
画圆遇到的问题:图片单位不一样,导致图片只能显示出圆的一部分:看代码: public class MyCircleIamge extends ImageView { private Context c ...
- .net该的帐
1.web api 2.socket通信 3.NUnit单元测试 4.了解自动化测试各种工具
- 循序渐进Python3(三) -- 2 -- 内置函数
上一篇我们介绍了21个最常用到的函数,简单列一下,帮助回忆巩固: 1.abs 2.dict 3.float 4.help 5.input 6.int 7.len 8.list 9.max 10.min ...
- ZMQ 在linux进程 和分布式之间的通信
ZMQ 在linux进程 和分布式之间的通信 待补全
- ubuntu初次安装后设置root用户密码
在ubuntu系统下,为了安全起见,在安装过程中,系统屏蔽了用户设置root用户. 设置方法如下: 登录普通用户 打开终端 sudo passwd[sudo] password for [userna ...
- UVALive 4818 - Largest Empty Circle on a Segment (计算几何)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...