formcycle 8.3.6 - JavaScript for forms
    Preparing search index...

    Map between the name of an event and the data for that event that is passed to the event listeners.

    interface AjaxUploadData {
        begin: { data: Blob; field: JQuery; fileName: string; id: string };
        cancel: { field: JQuery; id: string };
        clearError: { field: JQuery };
        complete: { container: JQuery; field: JQuery };
        error: { error: Error; field: JQuery; id: string };
        progress: { field: JQuery; id: string; progress: UploadRatio };
        remove: { field: JQuery; id: string };
        restore: { field: JQuery; id: string; item: FileItem };
        success: { field: JQuery; id: string; item: FileItem };
    }
    Index

    Properties

    begin: { data: Blob; field: JQuery; fileName: string; id: string }

    When an upload was selected and the AJAX upload was started.

    Type declaration

    • data: Blob

      The data that is uploaded to the server.

    • field: JQuery

      The upload element with the started upload.

    • fileName: string

      The name of the file that is uploaded to the server.

    • id: string

      The ID of the AJAX upload process.

    cancel: { field: JQuery; id: string }

    When a pending AJAX upload was cancelled, such as when the user presses the cancel button.

    Type declaration

    • field: JQuery

      The upload element with the cancelled upload.

    • id: string

      The ID of the AJAX upload process.

    clearError: { field: JQuery }

    When the error message of failed upload was cleared.

    Type declaration

    • field: JQuery

      The upload element with the cleared error.

    complete: { container: JQuery; field: JQuery }

    When all pending AJAX uploads are complete, irrespective of how they completed (via success, failure, or by being aborted). Whenever an AJAX upload completes, this event is triggered with the closest parent DOM element of the completed AJAX upload that contains only completed AJAX uploads.

    Type declaration

    • container: JQuery

      The container on which the event was triggered. It is guaranteed that all upload elements within this container do not have a pending AJAX upload.

    • field: JQuery

      The source element that finished its AJAX upload.

    error: { error: Error; field: JQuery; id: string }

    When a file upload failed, such as due to a network failure or checksum mismatch.

    Type declaration

    • error: Error

      The error that caused the upload to fail.

    • field: JQuery

      The upload element with the upload failure.

    • id: string

      The ID of the AJAX upload process.

    progress: { field: JQuery; id: string; progress: UploadRatio }

    When a pending upload made progress. This event is triggered in semiregular intervals, but no guarantees are made as to the exact timing.

    Type declaration

    • field: JQuery

      The upload element with the pending upload.

    • id: string

      The ID of the AJAX upload process.

    • progress: UploadRatio

      The current upload progress.

    remove: { field: JQuery; id: string }

    When an uploaded AJAX file was removed, such as when the user presses the remove button.

    Type declaration

    • field: JQuery

      The upload element with the removed upload.

    • id: string

      The ID of the AJAX upload process.

    restore: { field: JQuery; id: string; item: FileItem }

    When the AJAX file upload item was restored. This happens e.g. during server validation when the form is returned by the server.

    Type declaration

    • field: JQuery

      The upload element with the restored upload.

    • id: string

      The ID of the AJAX upload process.

    • item: FileItem

      File item that was restored.

    success: { field: JQuery; id: string; item: FileItem }

    When a file was uploaded successfully.

    Type declaration

    • field: JQuery

      The upload element with the successful upload.

    • id: string

      The ID of the AJAX upload process.

    • item: FileItem

      File item that was uploaded.