v7.3.0
SupportExamplesFree Trial

GridFeatures
Mixin

Mixin for Grid that handles features. Features are plugins that add functionality to the grid. Feature classes should register with Grid by calling registerFeature. This enables features to be specified and configured in grid config.

Define which features to use:

// specify which features to use (note that some features are used by default)
const grid = new Grid({
  features: {
     sort: 'name',
     search: true
  }
});

Access a feature in use:

grid.features.search.search('cat');

Basic example of implementing a feature:

class MyFeature extends InstancePlugin {

}

GridFeatures.registerFeature(MyFeature);

// using the feature const grid = new Grid({ features: { myFeature: true } });

Enable and disable features at runtime

Each feature is either "enabled" (included by default), or "off" (excluded completely). You can always check the docs of a specific feature to find out how it is configured by default.

Features which are "off" completely are not available and cannot be enabled at runtime.

For a feature that is off by default that you want to enable later during runtime, configure it with disabled : true:

const grid = new Grid({
     featureName : {
         disabled : true // on and disabled, can be enabled later
     }
});

// enable the feature grid.featureName.disabled = false;

If the feature is disabled by default, and you want to include and enable the feature, configure it as true:

const grid = new Grid({
     featureName : true // on and enabled, can be disabled later
});

// disable the feature grid.featureName.disabled = true;

If the feature is on by default, but you want to turn it off, configure it as false:

const grid = new Grid({
     featureName : false // turned off, not included at all
});

If the feature is enabled by default and you have no need of reconfiguring it, you can omit the feature configuration.

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isGridFeatures : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of GridFeatures class, or subclass thereof.

Functions

Functions are methods available for calling on the class

    Source path

    Grid/view/mixin/GridFeatures.js

    Contents