Pivot - tooltips

Hi,

I am trying to show tooltips in pivot as $$(“pivot”).$$(“data”).tooltip = true. But it has no effect. Is there any other ways to show tooltips?

This would be useful for first column “Name”.

Thanks

Hi Mika,

Try using $$(“pivot”).$$(“data”).define(“tooltip”, true);

Hi Helga,

Thank you. It works, but there is a small problem. Tooltip’s text contains icons and spaces of the tree node.

I have tried to iterate columns and modify “column.tooltip” but that not helped.

Is it possible to trim tooltip’s text?

Sure, it’s possible. You should define a template for the tooltip of the needed column. The template includes data property to display and additionally any text or html.

//enables tooltip for pivot table
$$("pivot").$$("data").define("tooltip", true);

//specifies tooltip for the necessary column
$$("pivot").$$("data").getColumnConfig('name').tooltip = "#name#";

I have tried

$$("$pivot1").$$(“data”).getColumnConfig(‘name’).tooltip = “#name#”;

But tooltip’s text still contains icons and spaces of the tree node.

Even

$$("$pivot1").$$(“data”).getColumnConfig(‘name’).tooltip = “123”;

doesn’t change tooltip’s text :frowning:

Have you enabled tooltip for the whole pivot table? Both lines that were mentioned above are necessary.

Yes, of course, This is my code:


var datatable = $$(“pivot”).$$(“data”);
datatable.attachEvent(“onAfterLoad”, function() {
sortFilters();
});

datatable.attachEvent("onStructureUpdate", function() {
    setColumnsFormat(datatable);
});

//datatable.tooltip = true;
datatable.define("tooltip", true);
datatable.getColumnConfig('name').tooltip = "#name#";

Your code works for me.

The getColumnConfig method takes column ID as parameter. You can try getting to the needed column by index:

datatable.config.columns[0].tooltip = "#name#";

Helga, found that tooltips are shown good when inline data used

data:pivot_dataset,

but when query

url: "http://192.168.1.3:9090/dataset.json",

used, they not.

May be I need to use event to define tooltip’s template?

Helga, I’ve got it work doing this way:

datatable.attachEvent("onAfterLoad", function() {
    this.getColumnConfig('name').tooltip = "#name#";
});