Re: [REACT] Set a default columnWidth and tickHeight
Posted: Mon Feb 13, 2023 11:29 am
by info@xnew.it
Hi Marcio,
thank you so much for your help.
In the end I found a good solution using the checkbox "fit width" and "no fit" to resize the columns.
I moved the both checkobox inside the layout menu. Only problem that I can't fix is to unchecked the "fit width" and checked the "no fit" when I resize the columns with the "columns width" slider.
I can't detect the fit button inside the
scheduler.widgetMap.fitButton?.menu.widgetMap
. Could you help me to find the right way to fix it?
Re: [REACT] Set a default columnWidth and tickHeight
Posted: Tue Feb 14, 2023 1:56 pm
by info@xnew.it
Hey,
Thank you so much for your suggestions. But as the checkbox, I can't access to the radio group buttons (or checkbox) from the slider "columnWidth" inside the onInput().
{
type: 'slider',
ref: 'columnWidth',
text: 'columns_width',
showValue: true,
min: 50,
max: 200,
value: 'up.resourceColumnWidth',
onInput({ value }) {
const scheduler = schedulerRef.current?.instance
const fitWidgetMap =
scheduler.widgetMap.fitButton?.menu.widgetMap || // <----- Need to change this value
{},
fitNoneButton = fitWidgetMap.none,
// fitFillButton = fitWidgetMap.fill,
fitFitButton = fitWidgetMap.fit
console.log(scheduler.widgetMap);
if (fitNoneButton) {
fitNoneButton.checked = true
// fitFillButton.checked = false
fitFitButton.checked = false
}
scheduler.resourceColumns.fitWidth = /*scheduler.resourceColumns.fillWidth =*/ null
scheduler.resourceColumns.columnWidth = value
dispatch(updateLocalConfig({ fitWidth: false, columnWidth: value }))
}
I need to move the option from fit to none when I resize the columns width with the slider. But I can't find the the checkbox or the radio group.
Re: [REACT] Set a default columnWidth and tickHeight
Posted: Tue Feb 14, 2023 4:07 pm
by info@xnew.it
Hey Bryntum team,
Ok I found a solution. I just gave a ref to the menu origin button to find the children inside the widgetMap.
Thank you so much for the help.
Re: [REACT] Set a default columnWidth and tickHeight
Posted: Tue Feb 14, 2023 4:11 pm
by marcio
Hey,
Glad that you found a solution and thanks for sharing it here, it'll help others that have a similar issue in the future!