[]
        
(Showing Draft Content)

Data Manager

SpreadJS provides a structured runtime data modeling engine called DataManager.

DataManager is the foundational data layer of SpreadJS.

Modern SpreadJS components such as TableSheet, GanttSheet, ReportSheet, and Data Chart consume structured data models defined by this engine.

The DataManager defines how data is:

  • Organized

  • Structured

  • Related

  • Validated

  • Calculated

  • Prepared for presentation

Each Workbook instance contains exactly one DataManager instance.

It can be accessed using:

var dataManager = spread.dataManager();

Although GC.Data.DataManager can be instantiated independently, a manually created instance is not connected to a Workbook. SpreadJS components operate only on the DataManager owned by the Workbook.

Role of DataManager in SpreadJS

The DataManager is responsible for:

  • Managing structured tables

  • Defining schema and column behavior

  • Establishing relationships between tables

  • Supporting hierarchical and computed data definitions

  • Creating views for presentation and component binding

It provides a modeling layer between raw data sources and UI components.

Conceptually, the object structure is:

Workbook
  └─ DataManager (1 per Workbook)
        ├─ Table (multiple)
        │     ├─ Schema (1 per Table)
        │     │     └─ Columns (multiple)
        │     └─ View (multiple)
        └─ Relationship (multiple)

This structure forms the foundation for all structured-data-driven components in SpreadJS.

Runtime and Designer

SpreadJS provides two environments for defining and working with structured data:

Runtime

Tables and models are defined programmatically using the DataManager API.

At runtime, you:

  • Access the Workbook’s DataManager

  • Create tables

  • Define schema

  • Establish relationships

  • Create views

Designer

Designer provides a visual configuration environment for defining the same data model.

In Designer, the Data Source panel allows you to:

  • Define structured tables

  • Configure schema and column behavior

  • Establish relationships

  • Enable hierarchical data

  • Apply validation and formatting rules

  • Preview configured data

All configurations made in Designer map directly to the runtime DataManager.

Designer does not introduce a separate data system — it provides a visual authoring layer for the same tables, schema, and relationships available through code.

For details about configuring data models in Designer, refer to the Designer documentation.

Why Use DataManager

Structured components such as TableSheet and GanttSheet require more than flat data arrays. They depend on:

  • Explicit table definitions

  • Column metadata

  • Data typing and validation rules

  • Inter-table relationships

  • View definitions for presentation

The DataManager enables you to:

  • Prepare structured data before binding to components

  • Define relational data models for multi-table scenarios

  • Configure hierarchy and computed fields

  • Reuse a single table across multiple components

  • Separate data modeling from UI presentation

Once a table is defined in the DataManager, it can:

  • Be bound to TableSheet or GanttSheet

  • Serve as a data source for ReportSheet

  • Drive Data Chart visualizations

  • Be reused across multiple components within the same Workbook

Data Modeling Workflow

Using DataManager typically follows this sequence:

  1. Obtain the Workbook’s DataManager

  2. Create one or more tables

  3. Define schema and column behavior

  4. Establish relationships (if multiple tables are involved)

  5. Create one or more views for presentation

  6. Bind the view to a structured component

This documentation is organized to follow that modeling flow, while keeping each core object independently discoverable.

How to Navigate This Documentation

This documentation is structured around the core modeling concepts of DataManager.

You can explore it in two ways.

Follow the Modeling Flow

If you are building a structured data model from scratch, read in this order:

  1. Getting the DataManager

  2. Creating Tables

  3. Defining Schema

  4. Table Relationships

  5. View

  6. Table Operations

  7. Integration with SpreadJS Components

This path reflects a typical end-to-end modeling process.

Explore by Core Object

If you are looking for a specific concept:

  • Table – Structured dataset container

  • Schema – Structural definition layer

  • Relationship – Cross-table modeling

  • View – Presentation projection

  • Operations – Data querying and synchronization

Each section can be read independently based on your needs.

What This Documentation Covers

The following sections explain:

  • How to access and work with the DataManager

  • How to create and configure tables

  • How schema and columns define data behavior

  • How relationships connect multiple tables

  • How views control presentation and binding

  • How data behavior such as synchronization and tracking is configured

Each section includes focused explanations and runnable examples to demonstrate practical usage patterns.