Version

List.getItemsWithOptions

This method is used to get the items in a SharePoint List, including a number of options to be used in the query to the SharePoint list. The options are passed through a custom options object detailed in the Parameters section below.

Syntax

SPlus.List.getItemsWithOptions (url, options, function (items){
        //TODO: Go through the items array and implement what to do with each item
}, function (errorResponse){
        //TODO: Implement how to handle errors
}, function (cancelResponse){
        //TODO: Implement how to handle a user’s cancel
});

List.getItemsWithOptions Parameters

Parameter

Type

Description

url

String

URl to the SharePoint list.

options

JavaScript Object

The custom Object options includes information to be used in the query to the SharePoint list. The Query schema of CAML is used to define queries against list data.

onSuccess callback function

Parameter

Description

function (items)

Success callback function to be implemented, which receives an Array with the items (JavaScript Objects that represent an item). Each property corresponds to each field specified in the options Object; all field values are returned with String type.

Note
NOTE

The List.getItemsWithOptions method returns items directly from the SharePoint server. It does NOT take into account offline changes not yet impacted to the server.

onError callback function

Parameter

Description

function (eResponse)

Error callback function to be implemented, which receives the eResponse JavaScript Object.

onCancel callback function

Parameter

Description

function (result)

Cancel callback function to be implemented.

For a sample with this API method, refer to the Getting items from a list using a query bridge scenario.