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

Tooltip MVVM Change Content Dynamically and Refresh

1 Answer 328 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Douglas
Top achievements
Rank 1
Douglas asked on 07 Nov 2014, 11:40 PM
Using MVVM, I have this span:

<span class="product-invalid" data-packageid="@Model.ProductPricing.Id" data-role="tooltip" data-auto-hide="true" data-position="right" data-bind="value: InvalidContent, events: { show: onInvalidTooltipShow }">&lt; Invalid &gt; </span>

It doesn't look like the Tooltip is not really meant to be used in a true MVVM context so I had to add the binder from this page: http://jsbin.com/omAPILo/1/edit?html,js,output

My problem is on the show event, I cannot figure out what the parameter is.  I am trying to get .data('kendoTooltip') from the argument but I nothing I try is working.  I can't use a straight find by class or id because there are multiple tooltips created in a loop, thus the data-packageid attribute which is used to look up the content for the tooltip and set it on the hovered element.

I've tried $(e) and $(e.sender), no idea what else to try.  I tried $(e.target) but target is not even defined.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 11 Nov 2014, 04:08 PM
Hello Douglas,

If I correctly understood the functionality you are trying to implement, you could use the show event to modify the content of the tooltip popup element. Similar to the way shown in this modified version of the sample page you have provided.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ToolTip
Asked by
Douglas
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or