setValue of lightbox section

Hello,
First I would like to congratulate you for this component. I’m studying it and I am increasingly fascinated by the possibilities.

So, I’m having trouble setting a value of one section when creating the event.
I tested the example (API for lightbox sections), but it did not work. I’m calling it on event “onLightbox” to set the value.

            scheduler.attachEvent("onLightbox", function(id){
                   scheduler.formSection('price').setValue(some value specif for this event);
            })

Could someone help me with this? Another thing, is it possible to set this section read only?

Thanks,
Robi

onLightbox event occurs before lightbox really opens, you can change code as

scheduler.attachEvent("onBeforeLightbox", function(id){ scheduler.getEvent(id).price = "some value specif for this event"; return true; })

I tested and it didn’t work. Do you have another idea?
I am working with version 3.0.

Hello, Robi.

Your initial code seems to be correct. Please note that ‘price’ in your case should be the name of the section.
I’ve created sample with the following code and each time lightbox is displayed event id is set in the correct field.

[code]scheduler.attachEvent(“onLightbox”, function(id) {
var ev = scheduler.getEvent(id);
scheduler.formSection(‘id’).setValue(ev.id); // note that here i am using name of the section instead of map_to property
});

scheduler.config.lightbox.sections=[
{name:“description”, height:130, map_to:“text”, type:“textarea” , focus:true},
{name:“id”, height:130, map_to:“nothing”, type:“textarea” },
{name:“custom”, height:23, type:“select”, options:sections, map_to:“section_id” },
{name:“time”, height:72, type:“time”, map_to:“auto”}
];[/code]
Can you please attach full code of your page?

Kind regards,
Ilya

Thanks, Ilya, it is working \o/
Other question: is it possible to define this section read only?