Local Data
Last updated
Last updated
The WireBootstrap Local Data Connector is included in the core WireBootstrap framework. The WireBootstrap Local Data Connector allows arrays of objects to be used as a pseudo data service. These local arrays appear to the client framework as data services that can be queried dynamically. This data can also be loaded from remote static JSON or CSV files.
Use the local
provider key to use the service provider for this data connector with a data source.
To use an object array as a source of data, set the array into the provider Data
property.
To use a JSON file as a source of data, set the url
property of the Json
provider property to the URL of the JSON file.
The example below will load the sales.json
file to be used as the source of data.
To use a CSV file as a source of data, set the url
property of the Csv
provider property to the URL of the CSV file.
The example below will load the sales.csv
file to be used as the source of data.
CSV files are read and converted into an array of JavaScript objects using Papa Parse. This library will be loaded from the following CDN location if the Papa
object has not already been loaded on the page.
To customize the configuration for Papa Parse for reading in CSV files, use the papa
provider property. This property is a pass-through to the native Papa Parse configuration.
The example below changes the default field delimiter to a pipe.
Service providers are able to tell consumers about the functionality they support through an allow
property. Below is a list of the functionality that the local service provider supports.
Name
Default
Description
Data
The static data to as the source of data. See details below.
Json
The Json data to use as the source of data. See details below.
Csv
The CSV data to use as the source of data. See details below.
Name
Supports
delete
false
discover
false
storedProcedure
false
tableQuery
true
tableQuery.orderBy
1 - Single field
tableQuery.groupBy
false
test
false
write
false