https://bryntum.com/products/scheduler/docs/api/Core/widget/Widget exposes no interface to set it's value programatically.
The following code are two widget configs that control the display range of the scheduler, the second one jumps to today, and also sets the datefield widget's value so it may be controlled properly corresponding to where the range was set (today).
This code works, albeit it disagrees with the types provided, as they do not expose the value property.
{
type: 'datefield',
format: 'dd DD.MM.YYYY',
id: 'date',
value: this.scheduler.startDate,
step: this.scheduler_step,
onChange: ({ value }) => {
if (this.scheduler_step === '1d') {
this.setDisplayRangeOfScheduler(value, 'day');
} else if (this.scheduler_step === '1w') {
this.setDisplayRangeOfScheduler(value, 'week');
}
}
},
{
type: 'button',
text: 'Heute',
tooltip: 'Springe auf heute',
onAction: () => {
const now = new Date();
this.setDisplayRangeOfScheduler(now, 'day');
// TODO: fix types, use exposed interface?
(this.scheduler.tbar.getWidgetById('date') as any).value = now;
}
}
Should the value interfaces be exposed in the types or is there a recommended way to achieve this instead?