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);
Functions
1
Functions
1Apply override. We strongly suggest that you at least specify maxVersion for your overrides.
Both minVersion and maxVersion are inclusive - the override will be applied when the current
product version falls within the range [minVersion, maxVersion].
class OriginalOverride {
static get target() {
return {
class : Original,
product : 'grid',
minVersion : '1.0',
maxVersion : '1.5'
}
}
}
| Parameter | Type | Description |
|---|---|---|
override | Object | An override class definition |