Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Luis Perez on Dec 04, 2009 08:08
open dhtmlx forum
Scheduler auto-sized event

First of all, thanks for all your good work.

I have a scheduler-related question. Sometimes I need to add events to the calendar that has start date but no end date; in this case what I do is to set the end date equal to the start date (both values are the same). The problem is that rendering in week view, the rendered event's height is so small (obviously because the end date is the same as start date), and only 1 line of text is visible inside the event, so if text is more than one or two words then the rest of the text cannot be readed. Giving a later end date is not the solution for me, because... what end date? How much time must I add? I cannot calculate it based on event's text length... the ideal solution would be if I can tell the event element UI (I guess it's a DIV) that auto-sizes based on it's contents...

I've spent hours trying to solve this, but finally I gave up... please help me.

Thank you very much.
Answer posted by Alex (support) on Dec 04, 2009 08:31

Hello,

unfortunately there isn't method that allows to increase the event height according to the size of its text.

But you can change the default size of the new event. To do that it is necessary to set some end_date property. The example for 2-hour events:

scheduler.attachEvent("onEventCreated",function(id,e){
    var event = scheduler.getEvent(id);
    event.end_date = scheduler.date.add(event.start_date,2,"hour");
})