Read only field in Event Window

Hi,

I want to show the calendar type along with other fields in the event window and it is read only field. I have not seen any light box label control. Also, I am trying with lightboxtext control and make it readonly on client side but no luck. could you help me how to solve this issue.

Thanks in advance for your support.

Regards,
Kamal

Hello,
there is no label control, but you can easily emulate it,
you need to define control on the client side, just add implementation for necessary methods(they may do just nothing, since we need only label from this control). scheduler.form_blocks["label"] = { render: function (sns) { return ""; }, set_value: function (node, value, ev) { }, get_value: function (node, ev) { return null }, focus: function (node) { } };
this code must be executed before scheduler initialization.
Then you should define server-side configurator for this control(inherit from LightboxField class) public class LightboxLabel : DHTMLX.Scheduler.Controls.LightboxField { public LightboxLabel(string name, string text) : base(name) { this.Type = "label";//type must be the same as declared in scheduler.form_blocks["label"] this.Label = text; } }
and thats it, you can use labels as any other controls

        scheduler.Lightbox.Add(new LightboxLabel("l1", "My Custom Label"));
        scheduler.Lightbox.Add(new LightboxLabel("l2", "My Second Custom Label"));

Hi,

Thanks for you reply.

I am able to add the label but the value of this label is coming from database. So I used to Map property but it is not taking this. Could you please guide how to assign the database value to this label.

Regards,
Kamal

Adding to it, is any possibility to make the readonly textbox(lightboxtext) based on conditions. Please let me know your views.

Regards,
Kamal

Hi,

I am able to solve this issue and seems it is working fine. I followed the below code to achieve this.

var calendarEventType = new LightboxText(“CalendarType”, "Calendar Type ");
calendarEventType.Type = “template”;

calendarEventType.Height = 50;
calendarEventType.MapTo = “CalendartType”;
sched.InitialValues.Add(“CalendarType”, “Personal Calendar”);
sched.Lightbox.Add(calendarEventType);

Thank you very much.

Regards,
Kamal