theme.config.json file

Overview

The theme.config.json file contains configuration of a theme part. This file is optional and can be set in the root folder of theme part, for example gbc-project-dir/theme/platform/mobile/theme.config.json.

Contents

The JSON object provided in this file has two main entries, conditions and widgetFactory.

conditions entry

The conditions entry is a JSON array containing theme part's conditions as described in Theme conditions.

widgetFactory entry

The widgetFactory entry is a JSON object that defines overrides to apply in cls.WidgetFactory. It replaces registrations made with cls.WidgetFactory.registerBuilder. Every subsequent widget instantiation uses the class defined by this override instead of the one defined in javascript code.

// sample theme/platform/mobile/theme.config.json
{
  "conditions": ["isMobile"],
  "widgetFactory": {
    "DateEdit": "cls.DateEditMobileWidget",
    "DateTimeEdit": "cls.DateTimeEditMobileWidget",
    "TimeEdit": "cls.TimeEditMobileWidget",
    "SpinEdit": "cls.SpinEditMobileWidget"
  }
}