.gotoDataSet()

Previous Next

Moves the processing flow to a specific data set in the data source.

Each data set consist of n records, where n is determined by the dataSetSize() function of the DataSourceMetaContainer object. The number of available data sets is the total number of records divided by n.

A new data set is queried only if the data is not already available on the client, or not anymore, possibly because the lifeTime() function has caused it to expire.

When you call this function, it is executed for all data sources in the container object. To move between data sets on a single data source's Rowset, use rowSet.gotoDataSet() instead.

Syntax

.gotoDataSet( indexoptions )

 

index     :=  { first | next | previous | index }

 

options   :=  {

     success:  success-function

,    error:  error-function

,    pKeys:  key-string

}

The required index is a string or an integer that identifies the data set that must become the active data set, using values as follows:

Value

Meaning

first

Move processing to the first data set relative to the current

next

Move processing to the next data set relative to the current

previous

Move processing to the previous data set relative to the current

index

Move processing to the data set that has index as its index.

 

CAUTION: The index is 1-based. The first item has index 1, not 0.

The optional options is a struct that can have the following items, all of which are optional.

Success-function is a function called after the data was processed on the client.

Error-function is a function called when an error occurs.

Key-string is a keys string that identifies a rowset. If key-string is passed, the gotoDataSet action is performed on this specific rowset.

 

Examples

$.udb('EMP').gotoDataSet('next');

$.udb('EMP').gotoDataSet('previous');

$.udb('EMP').gotoDataSet(3);

 

NOTE: The last of these Examples is equivalent to:

$.udb('EMP').rowSet('current').gotoDataSet(3);