Listgrid data management

The ListGrid component supports data management and handling operations, just like the DataDescriptor. With the ListGrid, you can save, modify and delete data. These data handling operations are available on the ListGrid instances. When using these, A save must also be called in order to execute every command within a transaction.

Operations executed on the ListGrid are executed on the ListGrid's DataDescriptor, as if the data handling operations were called directly on the DataDescriptor.  If the ListGrid has no assigned DataDescriptor, even if you call a save, it will not be saved, but the changes will be visible on the ListGrid.

Add

One or more data records can be added to the ListGrid by using the addDataRecord or addDataRecords methods. After adding them, the data records will be visible in the ListGrid. If the save method is called, the data record(s) will be saved to the ListGrid's DataDescriptor.

Update

Updating a data record in the ListGrid can be done by using the updateRow method. You need to specify the row index, which will determine which row will be modified. Following this, the modified row will be visible in the ListGrid.  If the save method is called, the data record(s) will be saved to the ListGrid's DataDescriptor.

Delete

A data record can be deleted by using the deleteRow method. The row index must be specified, which will determine which row will be deleted. After this, the row will be deleted from the ListGrid. If the save method is called, the data record(s) will be deleted from the Listgrid's DataDescriptor.

Save

Added, modified and deleted data records can be saved by calling the save method.

Changes made by the data handling operations are executed in the following order:

  • Data records marked for deletion are deleted
  • New data records are saved
  • Modified data records are saved.

These operations are executed in the same transaction, so if an error is encountered in either operation, the execution of every operation is suspended.