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

Was this helpful?

Introduction

PreviousColumnsNextExecuting Queries

Last updated 3 years ago

Was this helpful?

Executing a query directly against a data source returns a one-time result set. A is a class container that combines a query with a data source. It executes the query on behalf of consumers and stores the result set internally. It is then able to listen for changes that affect the query using . If the dataset picks up any changes, it will refresh the result set by re-running the updated query in the data service, update its internal result set, and alert consumers of the change.

This "live" connection to data services allows UI components to effectively talk to one another responding to user-interaction automatically without having to code them to explicitly handle events, refresh data, and re-bind their UI.

Configuration

A dataset constructor simply takes a data source and a query as a parameter.

const accountService = new wire.data.DataSource("custom", {
    ServiceRoot: "./account"
});

const query = wire.data.select().from("Users")
    .where().eq("fred", "x");
    
const dataset = new wire.data.DataSet({
    Source: accountService,
    Query: query
});

For more on datasets, visit the reference page.

DataSet
Data Events
DataSet