save

marks a data record as changed and initiates data saving

promise save(id id, [string operation,object obj] );
ididitem id
operationstring"update" (default), "insert", "delete", "move" or null
objobjectthe data object that is sent to the server
promisea promise of server-side processing for the result operation

Example

// first save data
webix.dp($$("grid")).save(
    webix.uid(),
    "insert",
    { user:"Jack Thorn", level:80 }
).then(function(obj){
    // then insert into the UI component
    webix.dp($$("grid")).ignore(function(){
        $$("grid").add(obj);
    });
}, function(){
    webix.message("Data was not saved");
});

Related samples

See also
Back to top