Options for a save via ajax.

interface SaveOptions {
    error?: ((e, status?) => any);
    headers?: Record<string, string>;
    parameters?: Record<string, any>;
    success?: ((r) => any);
    type?: string;
    url: string;
}

Hierarchy (view full)

Properties

error?: ((e, status?) => any)

Optional callback to execute if there was an error saving the data.

Type declaration

    • (e, status?): any
    • Parameters

      • e: any
      • Optional status: any

      Returns any

headers?: Record<string, string>

Optional headers to set on the ajax request. By default, the Toolkit will send a Content-Type:"application/json" header. If you provide your own headers this header will continue to be sent, unless of course you override it.

parameters?: Record<string, any>

Optional parameters to pass to the exporter. If you write a custom exporter you may wish to use this.

success?: ((r) => any)

Optional callback to execute once the data has saved successfully.

Type declaration

    • (r): any
    • Parameters

      • r: any

      Returns any

type?: string

Specifies the data type in which to format the data. Defaults to "json". This must match the name of an exporter registered with the given instance of the Toolkit.

url: string

URL to POST data to. Required.