Skip to main content
Version: 11.2

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();
});
EventApplies toOccurs when
beforecleardatasetData source objectsBefore a data set is cleared
showdataData source objectsNew data is available for display.