dhtmlx scheduler

Another question. Under the description field, how can I enter a multiline text reminder? A CR closes the window for entering data.

You can alter the render method as

scheduler.form_blocks.textarea.render=function(sns){
var height=(sns.height||“130”)+“px”;
var html="

";
if (sns.reminder) html+="
"+sns.reminder+"
";

return html;
}

and form config as


scheduler.config.lightbox.sections=[
{ name:“description”, height:200, map_to:“text”, type:“textarea” , focus:true, reminder:“any text here”},
{ name:“time”, height:72, type:“time”, map_to:“auto”}
]

I tried this, it does not seem to work.


Locally the sample approach works: “any text here” line always appears at the end of the description field.

Yes, I did notice that, and thought is was kind of nice, but I guess there was a mis-communication:   I was interested in entering the actual contents in multiple lines, with shift-CR not preserving the formatting for the actual description entry.


You can define custom event_text template:


scheduler.templates.event_text=function(start,end,event){
return “

”+event.text+"
";
}




Stilll does not seem to preserve the CR/LF construct for an entry for the description field.   Any way to do this?



Also, is there a way to word wrap this field on the month view? 


>> Stilll does not seem to preserve the CR/LF construct for an entry for the description field. Any way to do this?


do you mean the description field in the lightbox ? Locally its formatting is preserved.


Please, send us the screenshot that demonstrates the issue.


>> Also, is there a way to word wrap this field on the month view?


It is possible to increase the height of event line in the month view. For example each event can occupy 2 lines instead of 1 even width of the event text requires only one line.


This is the only possible solution. If you are interested in it, we can provide it.


I think I finally understand.  The custom even_text  method works once you click on the day view, but not on the month view in the calendar preserving the CR/LF format in the day view with SHIFT/CR.  So on the lightbox it looks ok.  So, I will incorporate your suggestion of:



scheduler.templates.event_text=function(start,end,event){
  return “

”+event.text+"
";
}




If you have a method of allowing two or three lines for a single event on a month view of the calendar that would probably solve the problem, so folks can see an event that has more text data.


You can try to define the following css class on the page to display events in month view in 2 lines:


.dhx_cal_event_clear{
height:26px;
white-space:normal;
}


This class should be included after dhtmlxscheduler.css






does not seem to work.  The calendar fails to render.

Please, provide the sample to recreate the issue


I did get it to work using:



<link rel=“stylesheet” href=“codebase/dhtmlxscheduler.css” type=“text/css” title="Conference schedule"
charset=“utf-8”>




       .dhx_cal_event_clear{
  height:26px;
  white-space:normal;
}




But now if there are multiple events, or I try to increase height to 39 pixels to get 3 lines, the next event in the day text tends to overlap with the preceeding text.


It is necessary to change also the following property:


scheduler.xy.bar_height = 39px;

adding this change to the scheduler config variable section results in a failure to render the calendar.  any thoughts?


there was a typo in the previous answer.


There should be scheduler.xy.bar_height = 39; instead of scheduler.xy.bar_height = 39px;

thanks, that works!