Read Only on lightbox section

Hi,

I’m trying to create a lightbox with customs sections.
the section config look like this :

scheduler.config.lightbox.sections = [
                                {name: "Weight", height: 50, map_to: "weight", type: "wheight_edt"},
                                {name: "Product", height: 50, map_to: "noProduct", type: "product_edt"},
                                {name: "Bundle", height: 50, map_to: "noBundle", type: "bundle_edt"},
                                {name: "User", height: 50, map_to: "noUser", type: "user_edt"},
                                {name: "", height: 0, map_to: "noEvent", type: "id_edt"},
                                {name: "time", height: 72, type: "time", map_to: "auto"}
                            ];

I’m then trying to set Read only mode on Product, Bundle and User section as describe in the doc on the onLightbox event:

scheduler.attachEvent("onLightbox", function(){
                                var wheight_edt= scheduler.formSection("Weight");
                                projet_edt.control.disabled = true;

                                var bundle_edt = scheduler.formSection("Bundle");
                                bundle_edt .control.disabled = true;

                                var user_edt = scheduler.formSection("User");
                                user_edt.control.disabled = true;
});

But the control.disabled return a type error on “Cannot set property ‘disable’ of undefined”.
As my section type is a custom one is it possible to use the read only mode or am I missing some syntax on the section.control.disable definition?

I think i have to go further in my explanations :wink:

I’m creating my custom sections like this using hard coded html:

scheduler.form_blocks["user_edt"] = {
        render: function (sns) { 
            var htmlUsers = comboBuilder(users); // using a combo builder to return select's options
            var htmlFormUser = "<div class='dhx_cal_ltext'><select name='users' >" + htmlUsers + "</select></div>";
            return htmlFormUser;
        }
...set_value ... get_value
};

I think i have to define the section.control.disabled but i can’t figure how.

Hi,
the .formSection method won’t recognize a ‘control’ element of the custom sections. Try retrieving the input from the ‘node’ propertyvar user_edt = scheduler.formSection("User"); var control = user_edt.node.querySelector("select"); control.disabled = true;

Thanks a lot this is working nicely.