spList.getItems Method

Get items from list of spList instance

Namespace : jSPoint
Class : spList
Released since : v0.2.0 (History)

  • Syntax
.getItems(fields, query)

  • Parameters
fields
Type : Array
Fields to retrieve
query
Type : string
CAML query to filter results
  • Return Value
Type : Array of JSON Objects
List Items found


  • Example
// Show title & priority for each tasks of John Doe in popup
var myFields = new Array("Title", "Priority");
var myQuery = "<Where><Eq><FieldRef Name='Assigned To' /><Value Type='Text'>John Doe</Value></Eq></Where>";

var myResults = myList.getItems(myFields, myQuery);

for (var i=0;i<myResults.length;i++) {
  alert(myResults[i].Title + " : " + myResults[i].Priority);
}

Last edited Feb 13, 2011 at 6:37 PM by GurYN, version 3

Comments

No comments yet.