onBeforeInsert

fires before sending data for item insertion

void onBeforeInsert(id id,object details);
id
idthe old ID of the related item details
objectthe object which holds the state of data saving

Example

dp.attachEvent("onBeforeInsert", function(id, details){
    //... some code here ... 
});

Details

1 . The id parameter contains the client-side item ID.

2 . The details parameter contains data saving details. For example, the client-side ID the operation type ("insert"), the data item object:

{
    "id":1565114023778,
    "data":{
        "rank":99,"title":"","year":"2012","votes":"100","id":1565114023778
    },
    "operation":"insert"
}

Note that returning false from the event handler will suppress request to the server:

const processor = webix.dp("$datatable1");
  processor.attachEvent("onBeforeInsert", () => {
    // cancel server request
    return false;
  })

Related sample:  DataProcessor: Canceling Server Request

See also
  • API
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.