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
  • Properties
  • Methods
  • Authentication
  • Allow
  • Discover Methods

Was this helpful?

  1. Reference
  2. wire.data

wire.data.DataSource

Use the DataSource class to create a connection to a data service.

Properties

Name

Type

Default

Description

Ajax

object

null

Headers

object

null

Model

object

null

Provider

object

null

ServiceRoot

string

null

URL end point for the data service used by the data source.

Methods

Name

Description

allow

cast

Static method that casts an object with the same data source properties into an instance of the DataSource class.

delete

deleteAsync

exec

Executes a query in a data service.

execAsync

Executes a query in a data service.

getResponseTable

serviceProvider

test

useBasicAuth

Tells the service provider to use Basic authentication when calling into the data service

useBearerAuth

Tells the service provider to use Bearer authentication when calling into the data service

write

writeAsync

Authentication

Use the Headers property to attach headers to the data service call.

const token = "Ajb9fur9jgk9f6jr";

const source = new wire.data.DataSource("custom", {
    Headers: { Authorization: "Bearer " + token }
});

The example above uses a token with the Bearer authentication. Below is an example that uses Basic authentication with a user name and password.

const userName = "pdougherty";
const password = "Password21#$"

const source = new wire.data.DataSource("custom", {
    Headers: { Authorization: "Basic " + window.btoa(user + ":" + password) }
});

Allow

The allow method exposes certain aspects of functionality available in the service provider.

Name

Type

Default

Description

discover

boolean

false

Does the service provider allow meta data about data elements in the data service to be dynamically read.

tableQuery

boolean

true

tableQuery.orderBy

number

0

Does table query support include the orderBy function. 0 = does not support order by, 1 = order by on a single field is supported, 2 = order by supported on multiple fields.

tableQuery.groupBy

boolean

false

Does the service provider support the groupBy function.

test

boolean

false

Does the service provider support testing data service availability.

storedProcedure

boolean

false

Does the service provider support building queries using

Discover Methods

Use the following methods to read meta data about the data contained in a data service.

Name

Description

discoverCatalogs

Returns the list of catalogs or databases from a data service using a synchronous call.

discoverCatalogsAsync

Returns the list of catalogs or databases from a data service using an asynchronous call.

discoverEntities

Returns the list of entities or tables from the database defined in the data service connection using a synchronous call.

discoverEntitiesAsync

Returns the list of entities or tables from the database defined in the data service connection using an asynchronous call.

discoverFields(config)

Returns the list of fields for an entity or table specified in config.entityusing a synchronous call.

discoverFieldsAsync(config)

Returns the list of fields for an entity or table specified in config.entityusing an asynchronous call.

discoverProcedures

Returns the list of stored procedures from the database defined in the data service connection using a synchronous call.

discoverProceduresAsync

Returns the list of stored procedures from the database defined in the data service connection using an asynchronous call.

discoverProcedureParameters

Returns the list of parameters for a stored procedure specified in config.procedureusing a synchronous call.

discoverProcedureParametersAsync(config)

Returns the list of parameters for a stored procedure specified in config.procedureusing an asynchronous call.

Previouswire.data.DataSetNextwire.data.DataTable

Last updated 1 year ago

Was this helpful?

Ajax options used by the data source to make calls to the data service if using .

Attached headers to the data service call. See for an example.

Optional to be used by the data source.

Configuration for the service provider used by the data source. This will be specific to the service provider. Visit for details.

Returned from the service provider. See details below.

Deletes data from a data service. See for details.

Deletes data from a data service. See for details.

Call into the service provider to transform data returned from a data service into a .

Returns the service provider instance. Visit for details.

Service provider must set for consumers to be sure testing the data service is supported.

Use this method to update data in a data service. See for details.

Use this method to update data in a data service. See for details.

Does the service provider support building queries using .

All the discover methods take a singe options parameter. This parameter will be specific to the service provider if applicable at all. See for examples. Visit the service provider documentation for details on discovery options.

For more on data sources, visit .

DataSource Discovery
Connecting to Data
service provider
jQuery Ajax
wire.data.DataModel
Service Providers
Writing Data Deletes
Writing Data Deletes
DataTable
Service Providers
TableQuery
Authentication
Allow
allow().test
Writing Data Updates
Writing Data Updates