Categories | Question details Back To List | ||
dhtmlxScheduler - a few questions 1) Is there a way to have the new event start time different than the current default time of 00:00 when creating an event in month view such as setting it as a default value for new event creation? 2) Is there a way in week view to have the full event Title show up in a popup DIV onHover? For instance I have a long Title such as: "THIS IS A VERY LONG TITLE THAT GETS TRUNCATED BECAUSE MY EVENT IS SHORT". The only thing visible would be "THIS IS A". Is it possible to show the enter Title (and potentially the details) when the mouse is hovered over the event? I tried attaching some events to the onHover event of the .dht_cal_event class just to see if I could get a js alert to popup without success. If there some other way of getting to the onHover event of scheduler event? Answer posted on Aug 26, 2009 09:48 >>1) Is there a way to have the new There is an inner event - onEventCreated scheduler.attachEvent("onEventCreated",function(id,e){ var date = scheduler.getEvent(id).start_date; date.setHours(some_value); scheduler.getEvent(id).start_date = date; }) >>2) Is there a way in week view to have the full event Title show up in a popup DIV onHover? Please check http://dhtmlx.com/docs/products/dhtmlxScheduler/doc/dhtmlxscheduler___custom_styling.html#redefining_content Third code snippet shows how custom tooltip text can be defined. Unfortunately current version has not inner events for different mouse actions, so it is not possible to attach custom code to mouse events. Answer posted by Jamie on Aug 26, 2009 11:22 Thanks for the help, that worked. And for others wanting a more sophisticated popup tooltip using jQuery here is what I did (keep in mind this is requires jQuery): scheduler.templates.event_bar_text=function(start,end,event){ var text = event.text.substr(0,20); return "<span class='event_wrapper' title='"+event.text+"' rel='" + event.id +"'>"+text+"</span>"; } scheduler.templates.event_text=function(start,end,event){ return "<span class='event_wrapper' title='"+event.text+"' rel='" + event.id +"'>"+event.text+"</span>"; } // Only attach a function to the hover event of the .event_wrapper class after the XML has completed loading. scheduler.attachEvent("onXLE",function(){ $('.event_wrapper').hover(function() { var id = $(this).attr('rel'); event = scheduler.getEvent(id); // DO STUFF WITH THE EVENT SUCH AS A COOL POPUP }); }); Answer posted by Support on Aug 27, 2009 01:14 The code which you are using will work for initially loaded content , but will not work for events after mode|date changing. ( the hover function will be attached only to the initially rendered events ) I think the more correct approach will be scheduler.attachEvent("onViewChange",function(){ $('.event_wrapper').hover(function() { var id = $(this).attr('rel'); event = scheduler.getEvent(id); // DO STUFF WITH THE EVENT SUCH AS A COOL POPUP }); }) Answer posted by Jamie on Aug 27, 2009 07:14 Going back to question number 2 in the original post and then the subsequent answer -- When I attempted to use the code snippet as follows, double clicking the event bar in month view doesn't open the form to edit the details. scheduler.templates.event_bar_text=function(start,end,event){ var text = event.text.substr(0,20); return "<span class='event_popup' title='"+event.text+"' rel='" + event.id +"'>"+text+"</span>"; } |