var web;
var spItems;
var position;
var nextPagingInfo;
var previousPagingInfo;
//listName = 'Claims',
var pageIndex = 5; // default page index value
var pageSize = 300; // default page size value
var Olist;
var clientcontext;
var camlQuery;
var tableContent='';
var items = [];
// This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model
$(document).ready(function() {
// clientcontext = new SP.ClientContext.get_current();
// oList = //clientcontext.get_web().get_lists().getByTitle("Claims");
// camlQuery = new SP.CamlQuery();
/// GetListItems();
// var rowCount = $('#CustomerGrid tr').length;
// console.log(rowCount);
$('#CustomerGrid').DataTable();
});
function GetListItems() {
//Set the next or back list items collection position
//First time the position will be null
camlQuery.set_listItemCollectionPosition(position);
// Create a CAML view that retrieves all contacts items with assigne RowLimit value to the query
camlQuery.set_viewXml("<View>" +
"<ViewFields>" +
"<FieldRef Name='Title'/>" +
"<FieldRef Name='Requestor'/>" +
"<FieldRef Name='Company'/>" +
"</ViewFields>" +
"<RowLimit>" + pageSize + "</RowLimit></View>");
spItems = oList.getItems(camlQuery);
clientcontext.load(spItems);
clientcontext.executeQueryAsync(Function.createDelegate(this,this.onSuccess),Function.createDelegate(this,this.onfail));
}
// This function is executed if the above OM call is successful
// This function render the returns items to html table
function onSuccess() {
var listEnumerator = spItems.getEnumerator();
var item;
while (listEnumerator.moveNext()) {
item = listEnumerator.get_current();
items.push(item.get_fieldValues());
//items.push(item.get_item);
}
console.log(items);
try{
//table.rows.add($(tableHTML)).draw(); //Append each list...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.