This is a migrated thread and some comments may be shown as answers.

Dynamic content

2 Answers 855 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 04 Jun 2014, 01:11 AM
I'm using a filter and setting the title attribute on an element, but the original title is appearing.

I find that I need to also do this:

$elem.data(kendo.ns + 'title', newTitle);

... for the new title to appear in the tooltip. However, IF I force a different tooltip to appear first, then my updated title attribute is displayed.

Seems to me that in _show, a test should be made to check if the title attribute has changed;

            if (!current || current[0] != target[0] || _hasNewContent(target)) {
                that._appendContent(target);
                that.popup.options.anchor = target;
            }

_hasNewContent can compare the current title attribute to the value that's been saved off and, if different, reset the content.


2 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 06 Jun 2014, 06:43 AM
Hi Gary,

From the provided information it seems that you need to refresh the tooltip content each time it's opened and the title of the element is changed - this can be achieved using the "show" event and the "refresh" method as demonstrated below:

var tooltip = $("#agglomerations").kendoTooltip({
    filter: "a",
    width: 120,
    show: function(e) {
        if(this.content.text() != this.target().data("title")) {
             this.refresh();
        }
    },
    position: "top"
}).data("kendoTooltip");

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Gary
Top achievements
Rank 1
answered on 09 Jun 2014, 09:51 PM
Thank you. That is very helpful.
Tags
ToolTip
Asked by
Gary
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Gary
Top achievements
Rank 1
Share this question
or