WireBootstrap
HomeDocsBuySupport
  • Introduction
  • Overview
  • Getting Started
  • Installation
  • Connecting to Data
    • Data Connectors
      • SQL Data
      • Custom Web Services
      • Local Data
      • Other Sources
    • Data Sources
    • Discovery
    • Building a Data Connector
  • Working With Queries
    • Select Queries
      • Query Extensions
    • Stored Procedures
    • Custom Web Services
    • Executing Queries
    • ORM
  • Writing Data
  • Updates
  • Deletes
  • Working with DataTables
    • Introduction
    • Filter and Sort
    • Select and Calculate
    • Joins
    • Rows
    • Columns
  • Working with DataSets
  • Introduction
  • Executing Queries
  • Transforms
  • Writing Data
  • Data Events
  • Working with Components
    • Introduction
    • Encapsulation
    • Configuration
      • Data
      • Events
      • Observables
      • Validation
      • Display
      • Vendor
      • Custom
    • Component
    • Web Frameworks
    • Building a Component
      • Hello World
      • Data Events
      • DataSets
  • Working With Data Events
    • Introduction
    • Event Basics
    • Event Data
    • Event Actions
  • Working with Themes
    • Introduction
    • Sample Data
    • Libraries
    • Pages
    • Building a Theme Project
  • Utilities
    • Formatting
    • Expressions
    • Collections
    • Spinners
    • Copy and Merge
    • Validation
    • Loading Assets
    • Service Calls
    • Download Files
    • Browser Location
    • Types
    • Promise
  • Reference
    • wire
      • wire.Collection
      • wire.download
      • wire.validate
    • wire.data
      • wire.data.DataEvent
      • wire.data.DataModel
      • wire.data.DataPromise
      • wire.data.DataSet
      • wire.data.DataSource
      • wire.data.DataTable
        • Columns
        • Rows
      • wire.data.StoredProcedure
      • wire.data.TableQuery
    • wire.ui
      • wire.ui.Component
      • wire.ui.validate
Powered by GitBook
On this page
  • Provider Key
  • Configuration
  • Data
  • Json
  • Csv
  • Allow

Was this helpful?

  1. Connecting to Data
  2. Data Connectors

Local Data

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.

Provider Key

Use the local provider key to use the service provider for this data connector with a data source.

const source = new wire.data.DataSource("local", {
    ...
});

Configuration

Name

Default

Description

Data

Json

Csv

Data

To use an object array as a source of data, set the array into the provider Data property.

const source = new wire.data.DataSource("local", {
    ...
    Provider: {
       Data: [
          { UserName: "jembid", FullName: "Joel Embid" },
          { UserName: "bsimmons", FullName: "Ben Simmons" }
       ]
    }
});

Json

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.

const source = new wire.data.DataSource("local", {
    ...
    Provider: {
       Json: { url: "./data/sales.json" }       
    }
});

Csv

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.

const source = new wire.data.DataSource("local", {
    ...
    Provider: {
       Csv: { url: "./data/sales.csv" }       
    }
});

Papa

The example below changes the default field delimiter to a pipe.

const source = new wire.data.DataSource("local", {
    ...
    Provider: {
       papa: { delimiter: "|" }       
    }
});

Allow

Name

Supports

delete

false

discover

false

storedProcedure

false

tableQuery

true

tableQuery.orderBy

1 - Single field

tableQuery.groupBy

false

test

false

write

false

PreviousCustom Web ServicesNextOther Sources

Last updated 1 year ago

Was this helpful?

The static data to as the source of data. See below.

The Json data to use as the source of data. See below.

The CSV data to use as the source of data. See below.

CSV files are read and converted into an array of JavaScript objects using . 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 .

Service providers are able to tell consumers about the functionality they support through an property. Below is a list of the functionality that the local service provider supports.

Papa Parse
native Papa Parse configuration
allow
details
details
details
https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.jscdnjs.cloudflare.com