Rows.filter()
note
This article is about the filter() function of the Rows object.
Rows.filter()
Filters the contents of a rows collection.
Syntax
*rows*.filter( *function*( *index*, *row* ) )
The required function is the function to be executed.
The optional index is the index key of the item in the rows collection for which the function is executed.
warning
The index is 0-based: the first item has index 0, not 1.
The filter is applied to each row in the row set. The optional row is the row that the function is currently being applied to. Effectively, this is the same object as returned by 'this'.
Example
This example returns rows from the EMP data source that have an AGE value of 65 or higher.
var retiredEmps = $.udb('EMP').rows().filter(function(index, r){
return r.cols('AGE').val() >= 65;
});
You get the same result with****'this’:
var retiredEmps = $.udb('EMP').rows().filter(function(index, r){
return this.cols('AGE').val() >= 65;
});