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

Tooltips on grid column headers

3 Answers 370 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 08 Feb 2019, 05:50 PM

Wanting to add tooltips to column headers on the grid.

Trying:

$(document).ready(function () {
    //grid header tooltip
    $('thead [data-title]').kendoTooltip({
        content: function (e) {
            return $(e.target).text();
        },
    });
})

 

Seems to work except there appears to be spurious tooltips.  Please see attached 1.png and 2.png.

These appear to be from title attributes from within child elements.  Please see 3.png and 4.png.

In the case of 3.png the title="" attribute appears to be dynamically added.

Would like to remove the empty title="" tooltip and convert the column menu tooltip due to title="Column Menu" to be of kendoTooltip as well (preferably using single initialization step).

 

 

3 Answers, 1 is accepted

Sort by
0
Edward
Top achievements
Rank 1
answered on 08 Feb 2019, 06:09 PM

Tried:

 

$(document).ready(function () {
    $("#admin_grid").find(".k-grid-add").addClass("k-state-disabled").prop("disabled", true);

    //grid header tooltip
    $('thead th[data-title]').kendoTooltip({
        content: function (e) {
            return $(e.target).text();
        },
    });
    $('thead a[title]').kendoTooltip().data("kendoTooltip");
})

 

This converts the Column Menu icon to have a kendoTooltip, but also generates an empty default tooltip above it, 5.png.

If inspect element, 6.png, the title attribute is dynamically converted to tooltip="" during the generation of kendoTooltip, seems like, resulting in two tooltips (kendoTooltip below and an empty title attribute based empty tooltip above it).

0
Edward
Top achievements
Rank 1
answered on 08 Feb 2019, 06:09 PM

Tried:

 

$(document).ready(function () {
    $("#admin_grid").find(".k-grid-add").addClass("k-state-disabled").prop("disabled", true);

    //grid header tooltip
    $('thead th[data-title]').kendoTooltip({
        content: function (e) {
            return $(e.target).text();
        },
    });
    $('thead a[title]').kendoTooltip().data("kendoTooltip");
})

 

This converts the Column Menu icon to have a kendoTooltip, but also generates an empty default tooltip above it, 5.png.

If inspect element, 6.png, the title attribute is dynamically converted to tooltip="" during the generation of kendoTooltip, seems like, resulting in two tooltips (kendoTooltip below and an empty title attribute based empty tooltip above it).

0
Edward
Top achievements
Rank 1
answered on 12 Feb 2019, 04:07 PM
Using latest jquery lib and kendo stylesheets from kendo.cdn seemed to resolve the issues...
Tags
Grid
Asked by
Edward
Top achievements
Rank 1
Answers by
Edward
Top achievements
Rank 1
Share this question
or