Skip to main content
LoadOptions
Options for loading data.
NameTypeDescription
data?anyOptional. JSON data to load directly.
dataType?stringOptional dataType to pass in the request
error?(e:any, status:any) => anyOptional function to call on load error.
headers?Record<string,string>Optional map of HTTP header values, if loading via URL.
incremental?booleanBy 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?booleanOptional, defaults to false. Tells VisuallyJs that the data is coming via JSON-P.
onload?FunctionOptional callback to execute once the data has loaded. Most often used when you are retrieving remote data (using url)
parameters?Record<string,any>Optional parameters to pass to the loader.
type?stringSpecifies 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?stringURL to retrieve data from. Optional, but you need to supply either this or data.