.each()

Previous Next

Iterates the execution of a function for each row set contained in the Rowset object.

Returns the 'this' object.

Syntax

.each( function index, row-set ) )

The required function is the function to be executed.

The optional index is the index key of the item in the rowset collection for which the function is executed. The index is 0-based: the first item has index 0, not 1.

The optional row-set is the row set itself. Effectively, this is the same object as returned by 'this'.

 

Example

This example shows the use of 'this' rather than the use of the index and rs parameters. For each of the specified rowsets, two actions are executed, of which the second is applied recursively to each record:

$.udb(["DEPT","EMP"]).rowSet('queried').each(

 function() {

         console.log(this.keysString());

         this.rows().each(function() {

                 console.log(this.cols('NAME').val() );

                 }

         }

);

 

See Also

Rows.each()