.gotoDataSet()

Previous Next

Moves the processing flow to a specific data set among the row set's data sets.

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 the data source to which the row set belongs. To move between data sets within the current row set of multiple data sources, use DataSourceContainer.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

rowSet.gotoDataSet('next');

rowSet.gotoDataSet('previous');

rowSet.gotoDataSet(3);

 

See Also

dsc.gotoDataSet()