v7.3.0

Override

Simplifies overriding class methods by allowing methods from another class to be used as overrides. Overrides are defined as own classes. They must at a minimum contain a static getter named `target´, which should return an object with the class to override. Apply the override by calling apply().

Versions can be specified in the override target config to only apply the override for specific product versions. Both minVersion and maxVersion are inclusive - the override will be applied when the current product version falls within the range [minVersion, maxVersion].

class TemplateColumnOverride {
    static get target() {
        return {
            class      : TemplateColumn,
            product    : 'grid',
            minVersion : '1.0',
            maxVersion : '1.5'
        }
    }

renderer(renderData) { // call overridden function (optional) const value = this._overridden.renderer.call(this, renderData);

return 'HELLO' + value; } } Override.apply(TemplateColumnOverride);

See also

No results

Functions

Functions are methods available for calling on the class

    Source path

    Core/mixin/Override.js

    Contents