AdapTable - Key Concepts

Summary

  • When developing with AdapTable there are 3 basic concepts to understand:
    • Adaptable Options — how to configure your AdapTable instance
    • Initial Adaptable State — the objects you provide to your application for first-time use
    • Adaptable API — how to access AdapTable at run-time

The 3 Concepts

The three concepts below are key to getting started and making AdapTable work for you.

Adaptable Options

Adaptable Options is a large group of property options which you can configure at design-time to set up AdapTable so that it fits the requirements or the containing application.

The available properties include the underlying Initial Adaptable State, the adaptableId and many groups of related options (e.g. Entitlements, Layout, Search, Edit, Menu etc.)

Hint

Many of the options are JavaScript functions which, if provided, AdapTable will invoke when required

Find Out More

Learn more about the options available in Adaptable Options Reference

Initial Adaptable State

Initial State is a group of objects written in JSON that you will define at Design Time.

Caution

Most Initial State is optional but the Layout section (with at least one Layout defined) is mandatory

It includes all the AdapTable Objects required for initial use of your hosted application e.g. Layouts, Filters, Reports, Alerts, Format Columns etc.

Note

  • Adaptable Initial State contains persistable objects and properties which can change during Application run-time
  • Adaptable Options contains behaviour and functionality that will never change post-creation

When an application starts for the first time, Initial Adaptable State is loaded, and then merged with any run-time changes effected by the user; which is then stored (and subsequently reloaded) as Adaptable State.

Find Out More

Learn how Initial State works in greater detail in Guide to using Adaptable State and the Initial State Reference

Adaptable API

The Adaptable API provides full, rich, programmatic, run-time access to all AdapTable functionality.

This allows you to access Adaptable State in a 'safe' manner.

Anything that is achievable in the AdapTable UI can be accomplised alternatively using the Adaptable API.

Indeed you can use Adaptable API connect to AdapTable's functionality via your own custom screens bypassing AdapTable's UI altogether

Find Out More

See the full contents of the Adaptable API in Technical Reference

Developer Guide

Fitting these 3 Key Concepts Together

These 3 concepts are linked together as follows when AdapTable is instantiated.

Note

  • This example uses AdapTable Vanilla but very similar patterns are used for AdapTable React, AdapTable Angular and AdapTable Vue
  • All create AdapTable Options and Initial State, but have different mechanisms for tying them in with AG Grid
const adaptableOptions: AdaptableOptions = {
  licenseKey: '<ADAPTABLE_LICENSE_KEY_HERE>', // license key you were given
  primaryKey: 'tradeId', // a unique column
  initialState: initialState, // Inital Adaptable State required
};
1
Configure AdapTable Options

Adaptable Options is required by the async static constructor to initialise and prepare AdapTable

const initialState: InitialState = {
  Dashboard: {
    Tabs: [{ Name: 'Grid', Toolbars: ['Layout', 'Pricing']}],
  },
  Layout: {
    CurrentLayout: 'Cars',
    Layouts: [
      {
        TableColumns: ['Model', 'Price', 'Make'],
        RowGroupedColumns: ['Make'],
        Name: 'Cars',
      },
    ],
  },
} as InitialState;
2
Provide Initial Adaptable State

Adaptable Options includes Initial Adaptable State as a mandatory property.

This must include a Layout, and in every real-world use case, additional objects.

const agGridConfig : AgGridConfig={
  gridOptions: gridOptions, // AG Grid GridOptions object
  modules: RECOMMENDED_MODULES // AG Grid modules required 
}
const api: AdaptableApi = await Adaptable.init(adaptableOptions, agGridConfig);
3
Manage run-time acccess through Adaptable API

The constructor asynchronously returns the Adaptable Api object to facilitate full run-time access to all AdapTable functionality

Find Out More