Error redefining scheduler.templates.tooltip_text with 4.4

Hi,

I’m testing the 4.4 update and some things are not working.

In my scheduler I’ve redefined the template tooltip_text like this:

scheduler.templates.tooltip_text = function(start,end,event) {
            console.log(event.id);
            var tooltip = "<table border='0'><tr>";
            tooltip += "<td align='center' valign='top' id='tooltip-foto'>";
            (...)
            window.tooltip_event_id = event.id;
            return tooltip;
        };

Now when the scheduler is loaded all the code from the template is executed for every loaded event. How can I prevent it?

Thx

Hi,
v4.4 added aria-labels to some elements. These labels currently do not have public templates and the label for event boxes uses tooltip_text template - so this template is expected to be called for each displayed event.
The simplest solution would be to disable aria attributes support
docs.dhtmlx.com/scheduler/api__s … onfig.html
If you don’t want to do it, the only solution for now would be to redefine the inner method for default attributes of the event box, something following should do:

[code]if(scheduler._waiAria){
scheduler._waiAria._eventCommonAttr = function(event, div){
div.setAttribute(“aria-label”, event.text));

if(scheduler.config.readonly){
	div.setAttribute("aria-readonly", true);
}

if(event.$dataprocessor_class){
	div.setAttribute("aria-busy", true);
}

div.setAttribute("aria-selected",
	(scheduler.getState().select_id == event.id) ? "true" : "false");

};
}[/code]

We’ll think on the solution for the issue in next version, most probably we’ll add separate templates for aria attributes

Setting ‘scheduler.config.wai_aria_attributes’ to false the scheduler is not rended as expected. The error comes after scheduler.load()

Expected: i.imgur.com/mBikoPP.png
With config.wai_aria_attributes to false: i.imgur.com/LDPAQQ0.png

I tried redefining scheduler._waiAria._eventCommonAttr as you proposed and it seems to work for now.

Do you think it’s easy to fix the error with config.wai_aria_attributes to false? It seems a more clean and less aggressive way to fix that.

Thx Aliaksandr

I’ve reproduced the issue, thanks. We’ll fix it and most probably we’ll release a bugfix-update in a week or two