Rowset.clear()
note
This article is about the clear() function of the Rowset object.
Rowset.clear()
Clears all rows from the row set.
Returns a UdbPromise object.
Syntax
$.udb( *ds* ).rowSet( *rowSet* ).clear( *options* )
.then( () => {
// success
})
.catch(() => {
// failure
})
.finally(() => {
// executed after success / failure is handled
});
*options* ::= {
[showdata]: *show-data*,
[noSelect]: *no-select*
}
*show-data* ::= { [true] | false }
*no-select* ::= { true | [false] }
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.
Show-data determines whether a showdata event is triggered after clearing, so that controls bound to the row set update themselves. The default is true.
No-select is used when the current record must not be reselected automatically after clearing. By default, the value is false.
Example
$.udb().each((index, ds) => {
ds.rowSet('current').clear();
});
Related events
| Event | Applies to | Occurs when |
|---|---|---|
| beforecleardataset | Data source objects | Before a data set is cleared |
| showdata | Data source objects | New data is available for display. |