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?

  1. Working with DataTables

Introduction

PreviousDeletesNextFilter and Sort

Last updated 4 years ago

Was this helpful?

A WireBootstrap is a JavaScript class that contains an array of objects much like records in a database table. The data table contains dozens of methods for working with the array of objects including filers, transformations, and calculations. This class is located at wire.data.DataTable.

The example below creates a new DataTable from an array of objects. The raw array is put into a public property called Rows. Also, a Columns array is created that contains information about each in the data table.

let users = [
    { Users: "jkratz", FullName: "Jamie Kratz" },
    { Users: "pdougherty", FullName: "Pat Dougherty" }
];

let table = new wire.data.DataTable(rows);

const rows = table.Rows;

const columns = table.Columns;

Note, it's a good idea to use let or var scope when declaring arrays of rows to be used with a data table. The array sits inside a data table as a reference and not a copy so using operations on the data table that are designed to change the data or the array will error if the array is declared using a const. However, if the table is being created for read-only purposes, it's safe to use a const.

DataTable
column