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

Show tooltip only on rows that exist in array.

1 Answer 369 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
ddub
Top achievements
Rank 1
Veteran
ddub asked on 29 Jun 2020, 10:36 PM

Hello,

Like the title says i am trying to show tooltip only on rows that exist in my array. I have a kendo grid with a checkbox, whichever checkbox the user clicks on i am storing that row in my $ctr.selectedRows[];

The example i have below, the tooltip shows up on all rows when they go back to their selection grid. I am either missing something, doing this wrong, or both.

        $("#grid").kendoTooltip({
          show: function(e){
            $ctr.selectedRows.forEach((element) => {
       this.content.parent().css("visibility", "visible");
            })
          },
          hide:function(e){
            this.content.parent().css("visibility", "hidden");
          },
          filter: "td:nth-child(1)", //this filter selects the first column cells
          position: "center",
          content: function(e){
            var dataItem = $("#grid").data("kendoGrid").dataItem(e.target.closest("tr"));
            var content = "Currently we have " + dataItem.UnitsInStock + "  " + dataItem.ProductName +"in stock";
            return content;
          }
        }).data("kendoTooltip");

 

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 01 Jul 2020, 11:42 AM

Hello,

Thank you for the code snippet. A possible approach to achieve the desired functionality is to add a custom class, for example "checked", and change the Tooltip filter configuration to "tr.checked". Here you will find a small example for reference.

Let me know how that works for you.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ToolTip
Asked by
ddub
Top achievements
Rank 1
Veteran
Answers by
Martin
Telerik team
Share this question
or