Click here to Skip to main content
15,887,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
clientContext = new SP.ClientContext(BaseUrl);
var oList = clientContext.get_web().get_lists().getByTitle(listName);
var itemArray = [];
for (var i = 0; i < data.length; i++) {
var items = data[i].split(",");
downloadID = items[0].trim();
noOfDownloads = items[1];

var itemCreateInfo = new SP.ListItemCreationInformation();
var oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('DownloadID', downloadID);
oListItem.set_item('NoOfDownloads', noOfDownloads);
oListItem.update();
itemArray[i] = oListItem;
clientContext.load(itemArray[i]);

}
}
}
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onFileUploadSucceeded1),
Function.createDelegate(this, this.onFileUploadFailed1)
);
}
Posted
Comments
Ben J. Boyle 9-Jul-15 10:51am    
You might want to format that code some so we can see the structure more easily (Code project allows you to select text and mark it as code, which will format for you). Also any information about the error you're getting would be useful too else all you'll get is speculation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900