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

Loading tooltip content before show

2 Answers 113 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 27 Dec 2018, 03:55 PM

Hi,

I'm using a kendoTooltip control with the content.url configuration.

The problem is it takes a second or so to load the content, which is a long time when you're hovering over something frequently.

I'd like to know if it's possible to programatically load the content in the background (say, a few seconds after the page loads). Then when the user hovers over the target control, the tooltip can display instantly (having already loaded the content).

Thanks,

George

2 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 31 Dec 2018, 07:37 AM
Hello George,

Pre-loading the Tooltip content on the initial page load would be an approach that would resolve the delay issue observed. To achieve the desired, make an ajax request to get the tooltip content on the page load and store the returned HTML in a <script> element on the page. Then, use a function that would return the content of that <script> element:
$(document).ready(function() {
    $('#tooltipcontent').html(response);
 
  });
 
  $("#container").kendoTooltip({
    filter: "span",
    content: function(e) {
      return $('#tooltipcontent').html();
    }
  });
});

Here yo could find a small sample implementing the above suggestion.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Veselin Tsvetanov
Telerik team
answered on 31 Dec 2018, 07:38 AM
Hello George,

Here is the Dojo sample implementing the discussed scenario.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ToolTip
Asked by
George
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or