Support Forum
Hi I implement but one error
Error
When clicking on cell it gives error
import { ResourceAssignmentColumn, AssignmentGrid, CellEdit, NumberColumn, ColumnStore, Override, AssignmentField, LocaleManager } from 'bryntum-gantt';
class CellEditFeatureOverride {
static get target() {
return {
class: CellEdit,
product: 'gantt'
};
}
startEditing(cellContext = {}) {
const me = this;
if (!(me.editorContext || me.grid.readOnly || me.grid.disabled)) {
const normalizedContext = me.grid.normalizeCellContext(cellContext),
record = me.store.getById(normalizedContext.id);
if (record.name === 'Linda') {
return false;
}
}
return this._overridden.startEditing.call(this, cellContext);
}
}
Override.apply(CellEditFeatureOverride);
Error
When clicking on cell it gives error
core.js:1673 ERROR TypeError: Cannot read property 'getById' of undefined
at CellEdit$1.startEditing (OverrideAssignment.js:16)
at CellEdit$1.onCellDblClick (gantt.module.js:140)
at Gantt.trigger (gantt.module.js:9)
at Gantt.triggerCellMouseEvent (gantt.module.js:140)
at Gantt.onElementDblClick (gantt.module.js:140)
at RegionResize.functionChainRunner (gantt.module.js:21)
at Gantt._0x65b84e.<computed> [as onElementDblClick] (gantt.module.js:21)
at Gantt.handleEvent (gantt.module.js:140)
at HTMLDivElement._0x48900f (gantt.module.js:9)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
Btw, this override is not needed anymore. Please check out beforeCellEditStart event. Docs here: https://www.bryntum.com/docs/gantt/#Grid/feature/CellEdit#event-beforeCellEditStart
Pavlo Miklashevych
Sr. Frontend Developer