How to remove tooltip effect for a particular set of columns of a datatable

Hi,
I have tooltip set for my datatable by default.
But for a set of columns I do not want the tooltip to be shown.
Few of my columns are having buttons in the cells under them and I am trying to remove the tooltip from them using onMouseMove event.

However, it is not working.
The snippet is here https://webix.com/snippet/0e30f930

Tagged:

Comments

  • you need to set tooltip:false to these columns

  • How will I do that ? Could you please show me in the example snippet ?

  • If tooltip is set to true or defined as a string template, set in configuration of columns

    mycols = [  
      { id:"id0", /* config...  */ tooltip:false   },
    ]
    

    If tooltip is a function, then you can make it conditional:

    tooltip: function(obj, common){
        var colId = common.column.id
        if (colId == "id4" || colId == "id5")
            return false;
        return obj[colId]
    },
    
  • Thanks. It works cool!

  • the tooltip function does not work.
    it shows the word false.
    https://snippet.webix.com/la1q0u9k

  • @MPaul ,
    Now you can just add tooltip: true to the datatable and it will work as well
    Please check the sample: https://snippet.webix.com/okfn6c4w

  • I want to hide the tooltip for certain criteria so in the tooltip function if I return false it shows the word false it does not hide it.

  • @MPaul
    try to return null or empty string

  • edited February 1

    Yep, returning an empty string will suppress the tooltip: https://snippet.webix.com/6rdyatia

    Probably in the next version we can tune to hide for null/false as well.

  • Thanks, Helga, That will do.

  • I have a webix spreadsheet with 2 sheets. I want different tooltips to appear depending on which tab is selected. I have the following code that works fine but puts the same tooltips on both pages.

    function mytip(obj, common){
    var column = common.column.id;
    if (column == 2) return "test";
    if (column == 3) return "";
    return obj[column];
    };
    const data = $$("ss").queryView("datatable");
    data.define("tooltip", mytip);

    I think I need to add something the const data definition to indicate it only applies to Tab1, but I can't work out how to do that. Any suggestions?

  • edited July 24

    Hey @geyres, if you mean that you want to display different tooltips depending on the current active sheet you could use an onAfterSheetShow event which returns the current sheet and check which sheet is active in your function: https://snippet.webix.com/ru7welzm.
    I would also like to note that you can refer to the datatable part of the spreadsheet by calling its inner id $$("s1").$$("cells") instead of using queryView.

Sign In or Register to comment.