Hello Bryntum team,
I shoud conditional an api call on my picker date button inside the tbar config. To do that I use some data from redux.I saw inside the config I didn't receive any update about external constants.
I also need to condition others function in the next task and I'd like to use some useState?
const { agendaDate } = useSelector(state => state.settings)
tbar: {
items: [
{
type: 'date',
value: 'up.startDate',
ref: 'datePicker',
step: '1d',
format: 'DD/MM/YY',
onChange({ value }) {
if (agendaDate) {
getApointments() // funcions to call api
}
const scheduler = schedulerRef.current?.instance
// Preserve time, only changing "day"
const diff = DateHelper.diff(
DateHelper.clearTime(scheduler.startDate),
value,
'days'
)
scheduler.startDate = DateHelper.add(
scheduler.startDate,
diff,
'days'
)
}
},
]
}
Is it possibile? How can I access to my state outside the config?