Skip to main content

Editing Data

FD Components uses an explicit dataset editing lifecycle. Records are browsed normally, then placed into append or edit state before field values are changed.

Append a record

customers.append();
customers.setFieldValue('company', 'New customer');
customers.setFieldValue('credit_limit', 5000);
customers.setFieldValue('active', true);
customers.post();

append() starts a new record. post() validates and commits the edit to the dataset lifecycle.

Edit the current record

customers.edit();
customers.setFieldValue('credit_limit', 50000);
customers.post();

To discard the active edit instead:

customers.cancel();

Delete the current record

customers.delete();

The same lifecycle is used whether editing is initiated programmatically, through FdcGrid, or through data-aware editors. This keeps temporary edit state and validation behavior in one place instead of distributing it across widgets.

note

post() completes the current record edit. Whether that posted change is immediately persisted or retained as a pending cached update depends on the dataset's update mode and storage setup.

Next: Saving Changes