Rowset object

Previous Next

This object contains a collection of references to one or more row sets and so-called keys strings containing key values (if any) that these row sets refer to. A Rowset object containing multiple row sets comes into play when you offer multiple controls based on the same data in the same interface.

Current row set

To refer to the currently selected row set, you can use 'current' as a value when invoking the Rowset object.

Example

This example returns the keys string of the current PERSON record:

$.udb("PERSON").rowSet('current').keysString();

 

Keys string

A Rowset object may simply refer to the main collection of records of a data source, in which case its keys string will be equal to "" (the empty string). It may also refer to a set of records linked to a record of another data source, most commonly to a parent record connected to the row set by a parent-child relation established through a Relate control object of a data source. The row set's keys string is composed in this case of all the parent records the row set is linked to, although most commonly this is a single parent data source and a single parent record in that data source.

You can call

.keysString() (Example 1 below) to get the keys string as a string.

.keyValues() (Example 2 below) to get the keys string as an object.

Example 1

This example returns a keys string as a object. This keys string identifies the parent keys of a TOUR record referenced by a current row set of the SCHEDTOUR child table. In this case, the key spans two columns:

$.udb("PERSON").rowSet('current').keyValues();

 

An example return value is:

{"1.DS59": { "$60" : "AUSTRALIA", "$61" : "ISLAND SUNTANNER" } }

 

 

Example 2

This example is the same as Example 1, but the return value is a string instead of an object:

$.udb("PERSON").rowSet('current').keysString();

 

An example return value is:

"1.DS59=$60:AUSTRALIA;$61:ISLAND%20SUNTANNER"

 

Functions

A Rowset object exposes the following functions:

Function

Description

.clear()

Function to clear the Rowset's rows.

.dataSet()

Function to get information about a data set in this Rowset.

.dataSetIndicator()

Function to get the current data set indicator of the Rowset.

.dbCount()

Function that returns the number of records in this Rowset as defined on the server (excluding inserted and deleted records).

.each()

Function to iterate over the row sets contained in the Rowset object.

.execute()

Function used to execute a function in the context of the Rowset, even if it is not the currently selected one.

.gotoDataSet()

Function to display or query a set of records given by a data set indicator for this Rowset.

.indexOf()

Function to find the index of a row set contained in the Rowset object. The index is 0-based: the first item has index 0, not 1.

.isEmpty()

Function to check whether or not this Rowset has been queried for records.

.isQueried()

Function to check whether the Rowset has been queried for records.

.keysString()

Function to get a row set's keys string as a string.

.keyValues()

Function to get a row set's keys string as an object.

.numberOfDataSets()

Function to get the total number of data sets of the Rowset.

.position()

Function to get the record position string of this Rowset.

.range()

Function to get the range of records string of this Rowset.

.rowCount()

Function that returns the number of records in this Rowset.

.rows()

Function to get a collection of records of the Rowset.

.select()

Function to make this Rowset the selected Rowset.

.sort()

Function that sorts the rows in a Rowset.