Default Selected Of Radio Button

I have a new section on my litebox I define the radio values with a variable as:
var myOptions = [
{ key: 2, label: ‘Option 1’ },
{ key: 1, label: ‘Option 2’ }

This is fine but how do I tell it to be default checked Option 1 when the form comes up?

You can’t define default option in config. But can use a bit of code to define default values for newly created events.

scheduler.attachEvent("onEventCreated", function(id){ scheduler.getEvent(id).some = 1; });

Sounds good but the variable is the ID for the event, right? The radio buttons I want to set defaults for are created in scheduler.config.lightbox.sections so the names onscreen seem to be random. How do I handle that situation?

You need not change id in above code to any other values. Basically each time when new event will be created, that function will be called with event’s id, and for that event default values of radio related property will be set.

Ok. Still confusing. If I literally put
scheduler.getEvent(id).some = 1;
into the event, the calendar acts weird when I try to create an event on the web page.

I then tried to put alert(id); into the scheduler and it returns a long temp number and only fires once. I still don’t understand how to set one item to a default value using this method.

Here is my code in …recurring.js:

var myOptions = [
{ key: 2, label: “Two” },
{ key: 1, label: “One” }
scheduler.config.lightbox.sections = [{ name: “description”, height: 50, map_to: “text”, type: “textarea”, focus: false },
{ name: “my_Options”, options: myOptions, height: 21, width: 50, map_to: “my_Options”, type: “radio” },
{ name: “recurring”, type: “recurring”, map_to: “rec_type”, button: “recurring” },
{ name: “time”, height: 72, type: “time”, map_to: “auto”}];

How do I use “onEventCreated” to know when my_Options, option “Two” is being created so I can set it to 1?