GridFeatureManager

Static class intended to register and query grid features (also applies to Scheduler, Scheduler Pro and Gantt).

A feature for Grid, Scheduler, Scheduler Pro or Gantt must extend InstancePlugin.

Note that features for Calendar and TaskBoard differ, they should not be registered with GridFeatureManager, and they use different base classes.

Registering a custom feature

First define a new feature, extending InstancePlugin:

export default class MyFeature extends InstancePlugin {
   // Class name, needed since the actual class name might be mangled by the minifier
   static $name = 'MyFeature';

   construct(client, config) {
       // Set things up here
   }
}

You can supply a construct function to set things up after the feature is plugged into the target component (Grid, Scheduler etc). Use it to for example register a click listener:

   construct(client, config) {
+      EventHelper.on({
+          element   : client.element,
+          thisObj   : this,
+          click     : this.clickCounter,
+          mouseover : this.trackMouse,
+      });
   }

+   clickCounter() {}

+   trackMouse() {}

Then register it with GridFeatureManager:

GridFeatureManager.registerFeature(MyFeature);

After that it is ready to use:

const grid = new Grid({
   features : {
     myFeature : true
   }
});

The feature name always starts with a lowercase letter

Functions

7

Gets all the default features registered for the given instance type name chain. First builds the type name chain then queries for features for each type name and combines them into one object, see getTypeNameFeatures() for returned object description.

If feature is registered for both parent and child type name then feature for child overrides feature for parent.

ParameterTypeDescription
instanceObject
Returns: Object

Gets all the features registered for the given instance type name chain. First builds the type name chain then queries for features for each type name and combines them into one object, see getTypeNameFeatures() for returned object description.

If feature is registered for both parent and child type name then feature for child overrides feature for parent.

ParameterTypeDescription
instanceObject
Returns: Object

Get all the default features registered for the given type name in an object where keys are feature names and values are feature constructors.

ParameterTypeDescription
forTypeString
Returns: Object

Get all the features registered for the given type name in an object where keys are feature names and values are feature constructors.

ParameterTypeDescription
forTypeString
Returns: Object

Checks if the given feature class is default for the given instance type name chain. If the feature is not default for the parent type name but it is for the child type name, then the child setting overrides the parent one.

ParameterTypeDescription
featureClassInstancePlugin

Feature to check

forTypeString
Returns: Boolean

Checks if the given feature class is default for the type name

ParameterTypeDescription
featureClassInstancePlugin

Feature to check

forTypeString
Returns: Boolean

Register a feature class with the Grid. Enables it to be created and configured using config Grid#features.

ParameterTypeDescription
featureClassfunction

The feature class constructor to register

onByDefaultBoolean

Specify true to have the feature enabled per default

forTypeString | String[]

Specify a type to let the class applying the feature to determine if it should use it