uploadXhrSuccess
File upload has been completed.
Please note - this property requires the Editor extension for DataTables.
Description
This event is triggered when a file has been uploaded using the upload or uploadMany field types, and provides the option of modifying the JSON data returned from the server. This can be useful if the server returns data in a form that does not match that expected by Editor or you wish to be notified whenever an upload is completed.
The event is triggered prior to the JSON returned from the server being processed by Editor, thus giving the ability to modify the data.
Type
function( e, fieldName, json )
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | e | No | |
Event object | |||
| 2 | fieldName | No | |
The field name that triggered the upload ( | |||
| 3 | json | No | |
JSON data returned from the server | |||
Example
Set the upload.id parameter in the JSON based on a non-Editor standard parameter.:
editor.on('uploadXhrSuccess', function (e, fieldName, json) {
json.upload = {
id: json.newFileId
};
});Related
The following options are directly related and may also be useful in your application development.