Everything we have done so far is related to updating the local data store residing in the memory of the web browser. More often that not, we will want to save our data back to the server to update a database, file system, or something along those lines.
This section will cover some of the more common requirements of grids used in web applications to update server-side information.
- Updating a record
- Creating a new record
- Deleting a record
Earlier, we had set up a listener for the afteredit
event. We will be using this afteredit
event to send changes back to the server on a cell-by-cell basis.
To update the database with cell-by-cell changes, we need to know three things:
field:
What field has changedValue:
What the new value of the field isrecord.id:
Which row from the database the field belongs to
This gives us enough information to be able to make a distinct update to a database. We communicate with the server (using AJAX) by...