TWebClientDataSet
Description
TWebClientDataSet
is the class for an in browser memory dataset. Client datasets can work with data retrieved from a REST
request or by directly assigning JSON arrays. They cache that data in memory, maintain a record of any changes in a change log, and apply cached updates at a later point back to the source of the data.
Properties for TWebClientDataSet
Property |
Description |
Active |
Specifies whether or not a dataset is open |
Connection |
Sets the TWebClientConnection component that can take care of performing the REST requests to load the data in the TWebClientDataSet |
DataSource |
Represents the data source of another dataset that supplies values to the dataset |
Fields |
Use Fields to access field components. If fields are generated dynamically at runtime, the order of field components in Fields corresponds directly to the order of columns in the table or tables underlying a dataset. If a dataset uses persistent fields, then the order of field components corresponds to the ordering of fields specified in the Fields editor at design time |
FieldDefs |
Points to the list of field definitions for the dataset |
Params |
Use Params to specify parameter values that the provider should pass to a source dataset |
RecNo |
Indicates the active record in the dataset |
RecordCount |
Returns the number of records in the dataset |
Rows: TJSArray |
JSON array property allow to set the dataset data from a JSON array |
Methods for TWebClientDataSet
Method |
Description |
Append |
Sets the dataset in insert mode by appending a new record to it |
AppendAsync: TJSPromise |
Promise based version of Append |
ApplyUpdates |
Sends all updated, inserted, and deleted records from the client dataset to the provider for writing to the database |
ApplyUpdatesAsync: TJSPromise |
Promise based version of ApplyUpdates |
Cancel |
Cancels unposted changes to the current record |
ClearFields |
Removes all fields from the fields collection |
Close |
Closes the dataset. Equivalent to setting Active = false |
Delete |
Deletes the active record and positions the dataset on the next record |
Edit |
Sets the dataset in edit mode |
EmptyDataSet |
Removes all data (records) from the dataset |
First |
Moves to the first record in the dataset |
Insert |
Puts the dataset in insert state |
InsertAsync: TJSPromise |
Promise based version of Insert |
Last |
Moves to the last record in the dataset |
Next |
Moves to the next record in the dataset |
Open |
Opens the dataset. Equivalent to setting Active = true |
OpenAsync: TJSPromise |
Promise based version of Open |
Post |
Writes a modified record to the Data property or the change log |
PostAsync: TJSPromise |
Promise based version of Post |
Prior |
Moves to the previous record in the dataset |
Events for TWebClientDataSet
Event |
Description |
AfterCancel |
Event triggered after a cancel operation on the dataset |
AfterClose |
Event triggered after a dataset close |
AfterDelete |
Event triggered after a delete operation on the dataset |
AfterEdit |
Event triggered after the dataset was set in edit mode |
AfterInsert |
Event triggered after the dataset was set in insert mode |
AfterOpen |
Event triggered after a dataset open |
AfterPost |
Event triggered after a post operation on the dataset |
AfterScroll |
Event triggered after a scroll |
BeforeCancel |
Event triggered just before a cancel operation will be performed on the dataset |
BeforeClose |
Event triggered just before the dataset will be effectively closed |
BeforeDelete |
Event triggered just before a delete operation will be performed on the dataset |
BeforeEdit |
Event triggered just before the dataset is set into edit mode |
BeforeInsert |
Event triggered just before an insert operation will be performed on the dataset |
BeforeOpen |
Event triggered just before the dataset will be effectively opened |
BeforePost |
Event triggered just before a post operation will be performed on the dataset |
BeforeScroll |
Event triggered just before a scroll will happen in the dataset |
OnCalcFields |
Occurs when an application recalculates calculated fields. |
OnDeleteError |
Occurs when an application attempts to delete a record and an exception is raised. |
OnEditError |
Occurs when an application attempts to modify or insert a record and an exception is raised. |
OnFilterRecord |
Occurs each time a different record in the dataset becomes the active record and filtering is enabled. |
OnNewRecord |
Occurs when an application inserts or appends a new dataset record. |
OnPostError |
Occurs when an application attempts to modify or insert a record and an exception is raised. |
OnUpdateRecord |
Occurs when cached updates are applied to a record. |