Tooltip visibility toggle based on task field

4 posts, 1 answers
  1. James
    James avatar
    20 posts
    Member since:
    Feb 2015

    Posted 20 Jul Link to this post

    Is there any way to toggle tooltips for different tasks in the Gantt based on a field set in the model? We have some tasks that require tooltips, and I made a template for them that displays some model fields. When a top-level (i.e., summary) task does not contain children, I've added a task that displays No Tasks as its title (per user requirements). It is for these 'No Tasks' tasks that I would like to completely toggle off tooltips. Any suggestions?

  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 22 Jul Link to this post

    Hi,

    Instead of assigning a string as the template, you can specify a function, where you can modify the template based on the task.

    Regards,
    Bozhidar
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. James
    James avatar
    20 posts
    Member since:
    Feb 2015

    Posted 22 Jul in reply to Bozhidar Link to this post

    I can and have done that for different task types already. What I am trying to do is completely turn off tooltips for specific tasks. I'm not sure that's feasible. Here's the latest version I tried - all selected items are as required, just am unable to turn off the tooltip for some tasks. Not setting anything in the tooltip template causes a small, empty tooltip to display.

    function onDataBound() {
        var gantt = this;
        ...
        gantt.element.find(".k-task-single").each(function (e) {
            this.style.border = "0px";
            this.style.height = "20px";
            var z = this;
            var xx = $(z).find(".taskProj"); // a class I added to a span inside the wrapper div in the task template
            var xxx = xx[0]; // there should only be one item in this array
            if ($(xxx).data("pid") === null) {
                $(z).tooltip.visible = false; // this isn't working
            }
        });
    }

  5. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 25 Jul Link to this post

    Hello,

    Thank you for clarifying. Since you can embed javascript code inside the template, you can use the following approach to hide the tooltip for certain tasks:
    http://dojo.telerik.com/iluqI/3 

    Regards,
    Bozhidar
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready