lundi 1 décembre 2014

How to get all items that are created in List



this code display the values from the textboxes in an alert box when u add in, how could i get all items and display the date and time? Here is my code.



context.executeQueryAsync(
function() {


var camlQuery = new SP.CamlQuery();


camlQuery.set_viewXml('<View><Query><Where><And><Leq><FieldRef Name=\'EventDate\' /><Value IncludeTimeValue=\'TRUE\' Type=\'DateTime\'>'
+ fromTime.toISOString() + '</Value></Leq><Geq><FieldRef Name=\'EndDate\' /><Value IncludeTimeValue=\'TRUE\' Type=\'DateTime\'>' + toTime.toISOString() +
'</Value></Geq></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