apply
(callback, params, async)domain: client
language: javascript
class Item class
Sends all updated, inserted, and deleted records from the item dataset to the application server for writing to the database.
The apply
method can have the following parameters:
callback
: if the parameter is not present and async
parameter is false
or undefined
, the request to the server is
sent synchronously, otherwise, the request is executed asynchronously and
after the response is received, the callback is executedparams
- an object specifying user defined params, that can be used
on the server in the
on_apply
event handler for some additional processingasync
: if its value is true, and callback parameter is missing, the request
is executed asynchronouslyThe order of parameters doesn’t matter.
The apply
method
Note
The server, before writing new records to the database table, generates values for the primary fields. The client updates these fields, based on information received from the server. If you change values of some other fields in the on_apply event handler, these changes will not be reflected on the client. You can update them yourself using, for example, refresh_record method
var self = this;
this.apply(function(err) {
if (err) {
self.alert_error(err);
}
else {
//some code to execute after appling changes
}
});