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

Tooltip visibility toggle based on task field

3 Answers 90 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 20 Jul 2016, 09:09 PM

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?

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 22 Jul 2016, 06:19 AM
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
0
James
Top achievements
Rank 1
answered on 22 Jul 2016, 09:17 PM

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
        }
    });
}

0
Accepted
Bozhidar
Telerik team
answered on 25 Jul 2016, 05:24 AM
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
Tags
Gantt
Asked by
James
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
James
Top achievements
Rank 1
Share this question
or