admin管理员组文章数量:1310143
i just want to know: Is there any way to get a SharePoint user using JavaScript/jQuery from default sharepoint-2010 user profile DB?
My requirement is to form an array of all SharePoint site users (user name) and use this array in a java function (that run behind the page at client side ) as a data source for a SPServices function.
Please provide any feasible solution or any other approach for building the array for JavaScript.
thanks
i just want to know: Is there any way to get a SharePoint user using JavaScript/jQuery from default sharepoint-2010 user profile DB?
My requirement is to form an array of all SharePoint site users (user name) and use this array in a java function (that run behind the page at client side ) as a data source for a SPServices function.
Please provide any feasible solution or any other approach for building the array for JavaScript.
thanks
Share Improve this question edited Feb 1, 2011 at 21:36 user229044♦ 240k41 gold badges344 silver badges346 bronze badges asked Feb 1, 2011 at 18:42 Ishaan PunianiIshaan Puniani 6582 gold badges10 silver badges23 bronze badges2 Answers
Reset to default 3There are two ways to do it:
Use client object model (OM) for ECMAScript:
- Get all users and groups client object model sharepoint 2010
SharePoint 2010: Client Object Model for JavaScript (ECMAScript)
The first article explains how to retrieve information about SharePoint users using OM and the second one shows how to use OM from JavaScript - you have to bine appropriate pieces of code.
Call appropriate method from the UserGroup service (e.g.
GetAllUserCollectionFromWeb
orGetUserCollection
) using jQuery:- Calling the SharePoint Web Services with jQuery
- Consuming WCF / ASMX / REST service using jQuery
- Calling WCF Service using jQuery in Sharepoint Applications
Using SPServices from codeplex:
<script type="text/javascript">
$(document).ready (function() {
$().SPServices({
operation: "GetListItems",
async: true,
listName: "User Information List",
CAMLViewFields: "<ViewFields>" +
"<FieldRef Name='Title' />" +
"</ViewFields>",
pletefunc: AttachMembersAutoComplete
});
});
function AttachMembersAutoComplete(xmlResponse) {
var domElementArray = $( "[nodeName=z:row]", xmlResponse.responseXML );
var dataMap = domElementArray.map(function() {
return {
value: $(this).attr('ows_Title'),
};
});
var data = dataMap.get();
$("input#inputMembersAutoComplete").autoplete({
source: data,
select: function(e, ui){
var tmpHTML = ui.item['value'];
$("#person_info").html(tmpHTML);
}
});
}
</script>
本文标签: javascripthow to get users from sharepoint user profile db using jqueryStack Overflow
版权声明:本文标题:javascript - how to get users from sharepoint user profile db using jquery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741826062a2399647.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论