I'm trying to edit a cell in a new column which I have added dynamically as part of a column group. The column group is in the middle region of a grid with three regions (left, middle and right):
addMonth(startMonth, startYear) {
const newMonthColGroupSuffix = '112019';
const newMonthCapacityFieldName = `capacity${newMonthColGroupSuffix}`;
const newMonthNumWorkDaysFieldName = `numWorkingDays${newMonthColGroupSuffix}`;
const newMonthForecastFieldName = `forecast${newMonthColGroupSuffix}`;
const newMonthActualFieldName = `actual${newMonthColGroupSuffix}`;
const newMonthTotalFieldName = `total${newMonthColGroupSuffix}`;
this.fieldNames.push(newMonthCapacityFieldName);
this.fieldNames.push(newMonthNumWorkDaysFieldName);
this.fieldNames.push(newMonthForecastFieldName);
this.fieldNames.push(newMonthActualFieldName);
this.fieldNames.push(newMonthTotalFieldName);
const store = new Store({
fields: this.fieldNames,
data: (this.gridEngine.store as Store).records.map(r => r.data)
});
store.commit();
this.gridEngine.store = store;
this.gridEngine.refreshRows();
this.gridEngine.columns.add({
text: 'November 2019',
align: 'center',
cls: 'labour-month',
children: [
{ field: newMonthCapacityFieldName, text: '%', type: 'percent', draggable: false, lowThreshold: -1, width: 53, align: 'center', region: 'middle'},
{ field: newMonthNumWorkDaysFieldName, text: '#<br>Days', type: 'number', draggable: false, width: 53, align: 'center', region: 'middle' },
{ field: newMonthForecastFieldName, text: 'Forecast<br>$', type: 'number', draggable: false, width: 81, align: 'center', region: 'middle' },
{ field: newMonthActualFieldName, text: 'Actual<br>$', type: 'number', draggable: false, width: 81, align: 'center', region: 'middle' },
{ field: newMonthTotalFieldName, text: 'Total<br>$', type: 'number', draggable: false, width: 81, align: 'center', region: 'middle' }
]
});
}
ERROR TypeError: Cannot read property 'scrollable' of undefined
at _0x5a2c48.scrollRowIntoView (grid.umd.js:16)
at _0x5a2c48.focusCell (grid.umd.js:16)
at _0x5a2c48.onFocusGesture (grid.umd.js:16)
at _0x5a2c48.onElementMouseDown (grid.umd.js:16)
at _0x9cb29a.functionChainRunner (grid.umd.js:12)
at _0x5a2c48._0x57b509.<computed> [as onElementMouseDown] (grid.umd.js:12)
at _0x5a2c48.handleEvent (grid.umd.js:16)
at HTMLDivElement.handler (grid.umd.js:11)
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:34182)
Would really appreciate some advice on how to get this working!
Thanks!
Ben