making details form readonly based on the description value

Hi All,

I’d like to be able to set the form to readonly based on a value that I will look for in the description field. It seems like the description may not yet be available on this event? It is however available on the “onLightbox” event, but I could not get the “this.getEvent(id).readonly = true;” to work on the “onLightbox” event. The form remains edittable. Any ideas on how to handle this?

scheduler.attachEvent(“onBeforeLightbox”,function(id){
// this doesn’t appear to get the description
var descr = scheduler.formSection(“description”).getValue();

 if(descr.substring(0,1) == "A")
 {
      this.getEvent(id).readonly = true;
 }

 // return true, so that the lightbox will continue to open
 return true;

});

Thanks

Ok, I figured out the solution. In the “onBeforeLightbox”, you have to use:

scheduler.getEventText(id);

to get the event’s text. I can then set the readonly property based on my custom needs.