lundi 1 décembre 2014

How to get all items



this code i have only gets current item that are added, but i want to get all items that are created,



ntext.executeQueryAsync(
function() {


var camlQuery = new SP.CamlQuery();


camlQuery.set_viewXml('<View><Query><Where><And><Gt><FieldRef Name=\'EventDate\' /><Value IncludeTimeValue=\'TRUE\' Type=\'DateTime\'>'
+ fromTime.toISOString() + '</Value></Gt><Gt><FieldRef Name=\'EndDate\' /><Value IncludeTimeValue=\'TRUE\' Type=\'DateTime\'>' + toTime.toISOString() +
'</Value></Gt></And></Where></Query></View>');
this.collListItem = list.getItems(camlQuery);
context.load(collListItem);
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
var listDetails = oListItem.get_item('EventDate') +" " + oListItem.get_item('EndDate');
result = result + listDetails;

alert(result);

}







0 commentaires:

Enregistrer un commentaire