Rowset.refresh()
This article is about the refresh() function of the Rowset object.
Rowset.refresh()
Refreshes the current data set of the row set. All other data sets become invalidated, and will be requeried when viewed again.
Any inserted (but not committed) records that are not re-queried in the current data set are made hidden and will re-appear when their appropriate data set is re-visited. Any gaps left by deleted (but not committed) records will be filled up.
Returns a UdbPromise object with the UdbRowSets object as parameter.
Syntax
$.udb( *ds* ).rowSet( *rowSet* ).refresh( *options* )
.then( ( *row-set* ) => {
// success
})
.catch(() => {
// failure
})
.finally(() => {
// executed after success / failure is handled
});
*options* ::= {
[current]: *current*,
[condition]: *condition*
}
*current* ::= { true | [false] }
*condition* ::= { *column* : *search-condition*, ... }
The required ds parameter is a data source selector.
The required rowSet parameter is a rowset identifier.
Options is a struct that can have the following items, all of which are optional.
Condition is a search condition that identifies the subset of rows that you want to be refreshed. See the Example below. The result of this "refresh" action is that the client will have the same records and the same values in these records as the server.
This is not the same as refreshing a subset of rows already present on the client; use the .refresh() function of the UdbRows object for that.
If current is set to true, only the currently shown data set is refreshed. If it is set to false (the default), the entire row set is refreshed.
If the row set is not yet queried, then no data set gets requeried, because a refresh can only be done when there are already queried records. This is also the case if there are only newly inserted records; these records are left as they are.
Also: any hostvars supplied earlier, e.g. by an .executeQuery() call, are re-applied here with the refresh.
Example
let rowSet = $.udb('EMP').rowSet('current');
rowSet.refresh({ condition: { BIRTHDAY: '>=01-JAN-1980' } });
Related events
| Event | Applies to | Occurs when |
|---|---|---|
| beforerefresh | Data source objects | Before a data source is refreshed. |