Tooltip MVVM Change Content Dynamically and Refresh

2 posts, 0 answers
  1. Douglas
    Douglas avatar
    9 posts
    Member since:
    Jul 2013

    Posted 07 Nov 2014 Link to this post

    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.
  2. Rosen
    Admin
    Rosen avatar
    3237 posts

    Posted 11 Nov 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top