<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I display hidden fields in a tooltip? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/611782#M50148</link>
    <description>&lt;P&gt;Thanks Kamlesh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nice solution and it does work for me ever.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this time when I try to reproduce it, it does not work.&lt;/P&gt;&lt;P&gt;I have checked the code and xml both are copied directly from you but really do not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any experience with this issue? or what setting can I configure, many thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2022 15:18:12 GMT</pubDate>
    <dc:creator>Vachel</dc:creator>
    <dc:date>2022-09-02T15:18:12Z</dc:date>
    <item>
      <title>How can I display hidden fields in a tooltip?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426116#M42826</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'd like to display a tooltip when someone hover the values of the first column of my table. This tooltip would display values taken from 3 hidden fields.&lt;/P&gt;

&lt;P&gt;My table looks like that : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;table id="tblTooltip"&amp;gt;
        &amp;lt;search base="fullKpi"&amp;gt;
          &amp;lt;query&amp;gt;
                 table reference,referenceOrder,validation_status
                 &amp;lt;/query&amp;gt;
                 &amp;lt;preview&amp;gt;
                   &amp;lt;set token="refOrder"&amp;gt;$result.referenceOrder$&amp;lt;/set&amp;gt;
                 &amp;lt;/preview&amp;gt;
        &amp;lt;/search&amp;gt;

        &amp;lt;fields&amp;gt;reference,validation_status&amp;lt;/fields&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and my JS looks like that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {

    var CustomTooltipRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            return cell.field === 'Reference';
        },
        render: function($td, cell) {
            var defaultTokenModel=mvc.Components.get("default");
            var tokenValue = defaultTokenmodel.get("refOrder");
            var message = cell.value;
            var tip = tokenValue;


            $td.html(_.template('&amp;lt;a href="#" data-toggle="tooltip" data-placement="left" title="&amp;lt;%- tip%&amp;gt;"&amp;gt;&amp;lt;%- message%&amp;gt;&amp;lt;/a&amp;gt;', {
                tip: tip,
                message: message
            }));

            // This line wires up the Bootstrap tooltip to the cell markup
            $td.children('[data-toggle="tooltip"]').tooltip();
        }
    });

    mvc.Components.get('tblTooltip').getVisualization(function(tableView) {

        // Register custom cell renderer
        tableView.table.addCellRenderer(new CustomTooltipRenderer());

        // Force the table to re-render
        tableView.table.render();
    });

});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to display the value of the field referenceOrder when hovering the reference field, however it displays "$result.referenceOrder$ in plain text&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6212iBC208C835E728042/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I saw another response (&lt;A href="https://answers.splunk.com/answers/495575/how-to-show-a-hidden-field-in-a-tooltip-when-i-hov.html"&gt;https://answers.splunk.com/answers/495575/how-to-show-a-hidden-field-in-a-tooltip-when-i-hov.html&lt;/A&gt;) with a workaround by combining hidden fields into a visible field and then splitting the values inside it, but I'd like to know if there's a way to do it properly ? Another token use or something maybe ?&lt;/P&gt;

&lt;P&gt;Any idea is welcome ! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 14:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426116#M42826</guid>
      <dc:creator>mattysherve</dc:creator>
      <dc:date>2018-12-07T14:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I display hidden fields in a tooltip?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426117#M42827</link>
      <description>&lt;P&gt;@mattysherve&lt;BR /&gt;
For your requirement we can use a trick. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Can you please try below XML and js code? &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;XML:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="tooltip.js"&amp;gt;
  &amp;lt;label&amp;gt;table tooltip&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="tblTooltip"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval reference="12345",referenceOrder="67890",validation_status="test" |  eval reference=reference."|".referenceOrder | table reference,validation_status&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;tooltip.js&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {

    var CustomTooltipRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            return cell.field === 'reference';
        },
        render: function($td, cell) {
            var message = cell.value.split("|")[0];
            var tip = cell.value.split("|")[1];


            $td.html(_.template('&amp;lt;a href="#" data-toggle="tooltip" data-placement="right" title="&amp;lt;%- tip%&amp;gt;"&amp;gt;&amp;lt;%- message%&amp;gt;&amp;lt;/a&amp;gt;', {
                tip: tip,
                message: message
            }));

            // This line wires up the Bootstrap tooltip to the cell markup
            $td.children('[data-toggle="tooltip"]').tooltip();
        }
    });

    mvc.Components.get('tblTooltip').getVisualization(function(tableView) {

        // Register custom cell renderer
        tableView.table.addCellRenderer(new CustomTooltipRenderer());

        // Force the table to re-render
        tableView.table.render();
    });

});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 18:45:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426117#M42827</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-12-10T18:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I display hidden fields in a tooltip?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426118#M42828</link>
      <description>&lt;P&gt;Thanks for the answer, that's what I went with. Even though it feels like a cheap trick, it seems to be the only way to do it !&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 13:53:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426118#M42828</guid>
      <dc:creator>mattysherve</dc:creator>
      <dc:date>2018-12-13T13:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I display hidden fields in a tooltip?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426119#M42829</link>
      <description>&lt;P&gt;Would this work for a timechart? I need to display the value for a field that isn't in the timechart. &lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 21:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/426119#M42829</guid>
      <dc:creator>cblanton</dc:creator>
      <dc:date>2019-09-23T21:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I display hidden fields in a tooltip?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/611782#M50148</link>
      <description>&lt;P&gt;Thanks Kamlesh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nice solution and it does work for me ever.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this time when I try to reproduce it, it does not work.&lt;/P&gt;&lt;P&gt;I have checked the code and xml both are copied directly from you but really do not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any experience with this issue? or what setting can I configure, many thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 15:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-display-hidden-fields-in-a-tooltip/m-p/611782#M50148</guid>
      <dc:creator>Vachel</dc:creator>
      <dc:date>2022-09-02T15:18:12Z</dc:date>
    </item>
  </channel>
</rss>

