DHTMLx scheduler - event_text customization

When customizing the event_text of a scheduler item, the double click logic ignores any nested html.



For example:



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

return ‘

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam id tellus. Nulla orci enim, vulputate et, pharetra eget, imperdiet non, sem. Mauris sit amet mi nec nulla porttitor dapibus. Curabitur leo sem, lacinia sed, commodo eu, mattis sit amet, felis. Ut tortor. Donec porttitor orci et neque. Curabitur eget diam at libero egestas suscipit. In tortor est, ullamcorper eu, dapibus et, condimentum nec, nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis vel purus eget diam aliquam luctus. Nullam risus ipsum, aliquam et, lacinia sit amet, fermentum vel, mi. In hac habitasse platea dictumst. Maecenas et dui non tortor lobortis feugiat. Donec eleifend iaculis arcu. Cras vitae leo nec nunc rhoncus laoreet. Integer eget enim. Nunc dignissim cursus mi. Donec eros.


};



This causes the light box to not appear when double clicking the text of the event. The reason for this is that the double click handler only performs an action if the first css class of the clicked element is one of three options : dhx_body, dhx_cal_event_line, or dhx_cal_event_clear.



Is there a reason you don’t recursively walk to see if an ancestor has one of those classes? It seems like you could move the logic call to _locate_event up in the _on_dbl_click function and use it as the mechanism for determining whether to call onDblClick.



Is there a reason the light box does not appear if the user clicks the dhx_title element?



If there are no plans to support html as a child div of dhx_body, could you please add an additional class type such as “dhx_body_child” so a developer could easily work around the issue by running jQuery to tag all the child components with a neutral css class the handler will respect. (Otherwise flagging all the elements in the custom html with dhx_body would have all sorts of wacky results which would have to be reversed by a second more specific css style.)



Thanks,

-Tom

Problem caused by existing click-detection routine, which applies different actions, based on the className of the target.
You can try to use the attached js file instead of the original one - it must work correctly with custom html elements inside of event’s text.

dhtmlxscheduler_0911.zip (19.7 KB)