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

Kendo ToolTip initially showing old data on show

1 Answer 331 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 16 Aug 2013, 02:42 PM
I have a kendo tool tip that I am updating dynamically depending on a list of checkboxes. Here is the code for the tool tip:
@(Html.Kendo().Tooltip()
       .Callout(false)
       .For("#frontNumberSelected")
       .Position(TooltipPosition.Right)
       .Width(200)
       .ContentHandler("changeToolTip")
       .Events(e => { e.Show("refreshToolTip"); })
)
When the tool tip is shown it is immediately refreshed to update the content using the following function:
function changeToolTip() {
            var result = "";
 
            if ($(".dcheck").filter(":checked").length > 0) {
 
                var toolTipContent = new Array();
                $(":checkbox").filter(":checked").each(function () {
                    toolTipContent.push($(this).val());
                });
                toolTipContent.sort();
 
                toolTipContent.forEach(function (e) {
                    result = result + e + "<br/>";
                });
            }
            else {
                result = "0 selected"
            }
             
            return result;
        }
 
        function refreshToolTip() {
            this.refresh();
        }

When the tool tip initially is shown it shows the previous content and then it updates. I understand this it because it is going through my loop on the checked boxes but is there a way to hold off on showing the tooltip until it is updated or is there another event I should be using to update my tool tip?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 20 Aug 2013, 08:38 AM
Hi Paul,

The Tooltip Widget does not have an event that is fired only when the control is initially loaded. I would suggest you to implement some logic that can determine if the page is loaded for the first time and then reset your filters, but unfortunately there is no built-in functionality that I can offer at the moment.

If you think that something like this would be useful, please submit it in our feedback forum, so it can be taken into consideration for a future release.
 
Regards,
Kiril Nikolov
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
Kelly
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or