Defines QueryCursor (not exposed on baja namespace).
new (require("baja/coll/QueryCursor"))(source, curData)
Cursor for a Query.
Extends:
Parameters:
| Name | Type | Description |
|---|---|---|
source |
baja.coll.QueryResult | |
curData |
Object |
Methods
-
after(func)
-
When the cursor is iterated, the before function will be called
just after iteration has finished.When the function is called,
thisrefers to the Cursor. The Cursor is also
passed in as a argument to this function.Parameters:
Name Type Description funcfunction the after function.
-
before(func)
-
When the cursor is iterated, the before function will be called
just before iteration starts.When the function is called,
thisrefers to the Cursor. The Cursor is also
passed in as a argument to this function.Parameters:
Name Type Description funcfunction the before function.
-
each(func)
-
Iterate through the Cursor and call a function for every item.
When the function is called,
thisrefers to the Cursor.Parameters:
Name Type Description funcfunction function called on every iteration with
the current row used as the first argument and row
index as the second argument.- Overrides:
-
get()
-
Return the current row.
- Overrides:
Returns:
the cursor value (null if none available)
-
getSource()
-
Return the underlying Cursor's data source.
Returns: