Our pure JavaScript Scheduler component
Dear support team,
I'm currently trying to change the columns of a scheduler instance at runtime. I'm getting a set of columns from an external configuration and can add them. But when trying to delete the current columns I don't find a handle to really identify them
only delivers the columns present during creation (even columns that were added later don't show up).
scheduler.columns.removeAll()
removes also the timeaxis which results in very strange error.
Is there an example or best practice to achieve this?
Best regards
René
To get current records in the ColumnStore:
scheduler.columns.records
This doesn't remove the time axis column for me, can you reproduce that online?
scheduler.columns.removeAll()
Hi mats,
no the example isn't online but it is reproducable with your examples, e.g. big data
scheduler.columns.records
(6) [RowNumberColumn, Column, Column, Column, NumberColumn, TimeAxisColumn]0: RowNumberColumn {masterStore: ColumnStore, _grid: Scheduler, _localizableProperties: Array(3), configuredListeners: undefined, meta: {…}, …}1: Column {masterStore: ColumnStore, _grid: Scheduler, _localizableProperties: Array(3), configuredListeners: undefined, meta: {…}, …}2: Column {masterStore: ColumnStore, _grid: Scheduler, _localizableProperties: Array(3), configuredListeners: undefined, meta: {…}, …}3: Column {masterStore: ColumnStore, _grid: Scheduler, _localizableProperties: Array(3), configuredListeners: undefined, meta: {…}, …}4: NumberColumn {masterStore: ColumnStore, _grid: Scheduler, _localizableProperties: Array(3), configuredListeners: undefined, meta: {…}, …}5: TimeAxisColumn {configuredListeners: undefined, widgetMap: {…}, masterStore: ColumnStore, _grid: Scheduler, _localizableProperties: Array(3), …}length: 6[[Prototype]]: Array(0)
scheduler.columns.removeAll()
true
scheduler.module.js?463787:12 Uncaught TypeError: Cannot read properties of null (reading 'isRoot')
at get region (scheduler.module.js?463787:12:264482)
at Scheduler.getSubGridFromColumn (scheduler.module.js?463787:53:104390)
at get subGrid (scheduler.module.js?463787:12:266753)
at TimeAxisColumn.onViewModelUpdate (scheduler.module.js?463787:53:317268)
at TimeAxisViewModel.trigger (scheduler.module.js?463787:10:72706)
at TimeAxisViewModel.update (scheduler.module.js?463787:53:1066101)
at set availableSpace (scheduler.module.js?463787:53:1071078)
at Scheduler.onSchedulerViewportResize (scheduler.module.js?463787:53:1136992)
at Scheduler.onBodyResize (scheduler.module.js?463787:53:1136713)
at ResizeObserver.onElementResize (scheduler.module.js?463787:10:527704)
get region @ scheduler.module.js?463787:12
getSubGridFromColumn @ scheduler.module.js?463787:53
get subGrid @ scheduler.module.js?463787:12
onViewModelUpdate @ scheduler.module.js?463787:53
trigger @ scheduler.module.js?463787:10
update @ scheduler.module.js?463787:53
set availableSpace @ scheduler.module.js?463787:53
onSchedulerViewportResize @ scheduler.module.js?463787:53
onBodyResize @ scheduler.module.js?463787:53
onElementResize @ scheduler.module.js?463787:10
scheduler.columns.records
[]
Hello,
You couldn't just remove the whole scheduler column and expect it to work. You could do this instead
scheduler.columns.remove(scheduler.columns.records.filter(r => !r.isTimeAxisColumn))
It will remove all columns except timeAxis column
But If you remove the whole column in the scheduler, it will give you an error.
Good Luck ,
Tasnim
Hi Tasnim,
that works like a charm