DataTables with DataStore Source

  Disclaimer: only canada.ca and gc.ca domains are allowed to make cross origin requests.

Overview

DataTables is a popular open-source JavaScript library that enhances standard HTML tables with powerful interactive features. It allows for displaying large datasets in a user-friendly way without having to build table functionality from scratch. It turns a basic HTML table into a feature-rich, interactive data grid with minimal configuration.

DataTables can populate a table by making AJAX requests to a remote API instead of relying on data already present in the HTML. This allows it to display dynamic data from a database or web service and is especially useful for large or frequently changing datasets. The two common approaches are client-side processing and server-side processing.

Download & Install

DataTables offers a package builder which will help you gather all of the dependencies you need in your webpage.

DataTables Options

For detailed descriptions of the DataTables options, read their official Options guide, which will help you determine the settings for your desired table output. Note that different Plugins may add more options.

Client-side Processing

With client-side processing, DataTables requests the data once from a remote API. After the data is downloaded, all searching, sorting, and pagination are performed in the user's browser. This approach is ideal when the dataset is relatively small (hundreds or a few thousand rows) and the API can return the entire dataset efficiently.

Resource: Open Government Portal Department List - Government of Canada Department List

Client Side DataTables w/ DataStore Search

javascript

Server-side Processing

For very large datasets, DataTables can operate with server-side processing. Instead of downloading every record on page load, DataTables sends a request every time the user interacts with the table, such as paging, column ordering, or searching. This allows DataTables to efficiently work with datasets containing millions of records while transferring only a small amount of data for each interaction.

Resource: Proactive Publication - Contracts - Contracts over $10,000

Server Side DataTables w/ DataStore Filters

javascript