Our pure JavaScript Scheduler component


Post by mcarner5 »

I feel like this is a really simple fix, however I can't get this working. I want to define a radiogroup as well as it's default value. I have followed the example here:
https://www.bryntum.com/products/scheduler/docs/api/Core/widget/RadioGroup

Which is :

 {
     type    : 'radiogroup',
     title   : 'Resolve Conflict',
     name    : 'resolution',
     value   : 'A',  // the default choice
     options : {
         A : 'Keep the original version',
         B : 'Use the new version',
         C : 'Reconcile individual conflicts'
     }
 }

Here is a snippet from my schedulerConfig I'm passing into the Scheduler component:

eventEdit: {

        items: {
            eventTypeField: {
                type: 'radiogroup',
                name: 'eventType',
                label: 'Event Type',
                flex: '1 1 auto',
                weight: 100,
                value: "appointment",
                options: {
                    appointment: 'Appointment',
                    meeting: 'Meeting',
                    timeOff: 'Time Off',
                },
                listeners: {
                    change: onEventTypeChangeHideOrShowFields
                }
            },
            ...
         }
}

However, it does not work. In my IDE, it gives me the following error on the "value" parameter:

TS2322: Type '{ type: "radiogroup"; name: string; label: string; flex: string; weight: number; value: string; options: { appointment: string; meeting: string; timeOff: string; }; listeners: { change: ({ source, value }: { source: any; value: any; }) => void; }; }' is not assignable to type 'boolean | Partial<ContainerItemConfig> | null'.   Object literal may only specify known properties, and 'value' does not exist in type 'Partial<RadioGroupConfig>'.


Post by tasnim »

Hi,

I'm not able to reproduce the issue with the latest version 5.6.7. What version of scheduler are you using?
Upgrading to the latest version should fix the issue!

Best regards,
Tasnim


Post by mcarner5 »

Tasnim,

Upon closer inspection it appears setting the 'value' property does work for setting a default, however my IDE is trying a TS error. Not sure why that is, but I can suppress it. It does this even after updating to the latest version 5.6.7. Oddly enough, when I CTRL-click the value prop it takes me to value under the CheckBoxConfig in scheduler.d.ts. It seems like it may be an issue with my IDE but I'm not sure. I am on Intellij Ultimate Build #IU-223.8836.41, built on March 9, 2023

IDE ts error radiogroup value prop.png
IDE ts error radiogroup value prop.png (124.36 KiB) Viewed 90 times

Post by mats »

That looks like a docs bug, we'll get that fixed!


Post Reply