.execute()

Previous Next

Executes a function in the context of this row set, even if this row set is not the selected one. This allows e.g. operations on records of this Rowset without disturbing the current (actual) selection of a row set.

Returns a Promise object or the 'this' object.

Syntax

.execute( function, promise )

 

promise    ::= { true | false }

The required function is the function executed.

If the optional promise has the value of 'true' (the default), a Promise object is returned. The .then() clause for this Promise is executed once all Promises created by the function passed to .execute() have been settled. If promise has the value of 'false', the ‘this’ object is returned instead.

 

Example

var rowSet = $.udb(this.dsId).rowSet(pRef);

rowSet.execute(

 function(){

         if ($this.hasClass("previous"))

                 dsi = rowSet.dataSetIndicator - 1;

         else

         if ($this.hasClass("next"))

                 dsi = rowSet.dataSetIndicator + 1;

         else

                 dsi = $this.prop("count");

                 if (dsi)

                         rowSet.gotoDataSet(dsi);

 }

);