Newer Version Available
Deleting Records with Remote Objects
Delete records by calling del() on a Remote
Objects model instance.
del() accepts two arguments,
both optional, and can delete one or many records, depending on the
arguments that you provide.
record_ids is an array of strings, where the strings are
the Ids of records to be deleted. If this
parameter is omitted, the Id that is set on the
Remote Object instance is used. The simplest way to delete a record is to call del() on
itself.
More often, you might need to delete a record in response to a
button click. Deleting the record is as simple as getting the record’s Id from the page and then passing
the Id to del(). For example:
Robust code includes a callback to handle errors. The following
code accomplishes the same as the previous sample, altered to use
an event handler and a callback function.
To delete multiple records in one request—for example, checked
items from a list—pass an array of Ids to del().