Often event on templates.tooltip_text

Hello,

I using in scheduler.templates.tooltip_text ajax method to get data from database. This function is trigger event very often when mouse is over the box (even if mouse is slide for a few pixels).

Could you advise me, how to use tooltip_text, to trigger it only once when mouse is over the box?

scheduler.templates.tooltip_text = function (start, end, event) { var msg = ""; if (event.id.toString().length < 6) { $.ajax({ url: '/planning_plugin/get_issue_info', type: 'post', data: { issue_id: event.id, issue_tracker: event.tracker_id }, async: false, failure: function () { alert("Error:[get_issue_info]"); }, success: function (data) { msg = "<table>" + "..."+ "</table>"; } }); } return msg; };

You can store the loaded data in the event object

success: function (data) { msg = "<table>" + "..."+ "</table>"; event._mytooltip = msg; //store }

And use it at the start of tempalte

scheduler.templates.tooltip_text = function (start, end, event) { if (event._mytooltip) return event._mytooltip; ... existing code here ... };

Clever :slight_smile:

thanks yours suggestion issue is solved.

Thank you very much. :wink: