Skip to main content

LoadOptions

Options for loading data.

Properties

data?

optional data: any

Optional. JSON data to load directly.


dataType?

optional dataType: string

Optional dataType to pass in the request


error()?

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

Optional function to call on load error.

Parameters

e

any

status?

any

Returns

any


headers?

optional headers: Record<string, string>

Optional map of HTTP header values, if loading via URL.


incremental?

optional incremental: boolean

By default the model's load method is incremental, meaning it does not clear itself when loading new data. Set this flag to false if you want the model to call clear() after parsing the data (either passed in directly or having been retrieved from a url) and before loading it.


jsonp?

optional jsonp: boolean

Optional, defaults to false. Tells VisuallyJs that the data is coming via JSON-P.


onload?

optional onload: Function

Optional callback to execute once the data has loaded. Most often used when you are retrieving remote data (using url)


parameters?

optional parameters: Record<string, any>

Optional parameters to pass to the loader.


type?

optional type: string

Specifies the data type of the data to load. Defaults to json. This must match the name of a loader registered with the given instance of VisuallyJs.


url?

optional url: string

URL to retrieve data from. Optional, but you need to supply either this or data.