function retrieveListItemsInclude(param) {
// debugger;
//var id = param;
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('GEN2ESW_Content_To_Do_Queue');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><RowLimit>100</RowLimit></View>');
this.collListItem = oList.getItems(camlQuery);
clientContext.load(collListItem, 'Include(Id, DisplayName, HasUniqueRoleAssignments)');
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded(sender, args) {
var listItemInfo = '';
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) {
//if (oListItem.get_id() == param)
{
//SPListItem item = list.GetItemById(1); //Suppose you want to retrieve the 1st item from the custom list.
// string URL = item[“URL”].ToString(); //Trying to retrive the value of URL which is of type Hyperlink or Picture
var oListItem = listItemEnumerator.get_current();
listItemInfo += '\nID: ' + oListItem.get_id() +oListItem.get_path()+
'\nDisplay name: ' + oListItem.get_displayName() +
'\nUnique role assignments: ' + oListItem.get_hasUniqueRoleAssignments();// + oListItem['URL'].ToString(); //+ '\n URL = ' + oListItem.get_url();
}
}
alert(listItemInfo.toString());
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
|
|||
|