Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically change the content of the tooltip in kendoui

I have a drag and drop functionality. When the element is dragging, I want to dynamically set the position of the element and display that in the tooltip. How can i able to do this using kendoui.

I have defined like:

<div id='drag'><p>Drag me</p></div>

I have defined the tooltip like:

$("#drag").kendoToolTip({
   position:"top",
   content: "Initial"
});

Thne for dragging

 $("#drag").draggable({
   drag: function(){
       $("#drag").data("kendoToolTip").content("Dragging");
    },
   stop: function(){
      $("#drag").data("kendoToolTip").content("Drag stopped");
    } 
 });

And i want to show the tool tip on the div continuously on dragging. How can i do that Any help is appreciated

like image 254
Jonathan Avatar asked Apr 20 '13 07:04

Jonathan


People also ask

How do I display dynamic content in tooltip?

The tooltip content can be changed dynamically using the AJAX request. The AJAX request should be made within the beforeRender event of the tooltip. On every success, the corresponding retrieved data will be set to the content property of the tooltip.

What is tooltip in kendo?

The Tooltip displays a popup hint for a specific HTML element. Its content can be defined either as static text or loaded dynamically with AJAX.

How do I hide Kendo tooltip?

In order to invoke the method hide of kendoTooltip you should do: tooltip. data("kendoTooltip"). hide();


1 Answers

try this one friend,

 $("#drag").data("kendoTooltip").options.content = "set content here...";

 $("#drag").data("kendoTooltip").refresh();
like image 81
surbob Avatar answered Nov 15 '22 06:11

surbob