<?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: Help with java script used for tooltip in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-java-script-used-for-tooltip/m-p/394636#M25820</link>
    <description>&lt;P&gt;require([&lt;BR /&gt;
     "splunkjs/mvc",&lt;BR /&gt;
     "splunkjs/mvc/tokenutils",&lt;BR /&gt;
     "jquery",&lt;BR /&gt;
     "splunkjs/mvc/searchmanager",&lt;BR /&gt;
     "splunkjs/ready!",&lt;BR /&gt;
     "splunkjs/mvc/simplexml/ready!"&lt;BR /&gt;&lt;BR /&gt;
     ],&lt;BR /&gt;
     function(&lt;BR /&gt;
         mvc,&lt;BR /&gt;
         TokenUtils,&lt;BR /&gt;
         $,&lt;BR /&gt;
         SearchManager&lt;BR /&gt;
         ) {&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    function setDelegate(panel, toolTip){

             $(panel).on("mouseover",function(){  
        var tokens = mvc.Components.get("submitted");   
                tokens.set(toolTip,"true");
             });

             //On mouseout() event unset the show token for the Tooltip to hide the same.
             $(panel).on("mouseout",function(){
                var tokens = mvc.Components.get("submitted");   
        tokens.unset(toolTip);
             });

        }

         //jQuery to access Panel with ID and use mvc.Components.get() function to get all Submitted Tokens.
         //On mouseover() event set the show token for the Tooltip

     console.log("loop tokens - function delegation, starting loop");
     for(i=1;i&amp;lt;50;i++)
         { 
         var p = "#panel" + i;
         var ttp = "tokToolTipShow" + i;
         setDelegate(p, ttp);   
     }


     }
 );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Jun 2019 16:13:31 GMT</pubDate>
    <dc:creator>satyaallaparthi</dc:creator>
    <dc:date>2019-06-10T16:13:31Z</dc:date>
    <item>
      <title>Help with java script used for tooltip</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-java-script-used-for-tooltip/m-p/394635#M25819</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have the requirement to keep tooltips for each dashboard panel.&lt;/P&gt;

&lt;P&gt;I have 4 panels and I created 4 tokens in javascript and kept each token in each panel. &lt;/P&gt;

&lt;P&gt;Can anyone help me with the javascript that can create with a loop where I don't have to create each token for each panel and keep the common id as ToolTip.&lt;/P&gt;

&lt;P&gt;Because it will be hard to create 50 tokens in javascript if I have 50 panels in the dashboard. &lt;/P&gt;

&lt;P&gt;Below is the script that I am using for tooltip.&lt;BR /&gt;
Please help me with this script. &lt;BR /&gt;
Thanks in advance.&lt;/P&gt;

&lt;P&gt;Javascript:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     "splunkjs/mvc",
     "splunkjs/mvc/tokenutils",
     "jquery",
     "splunkjs/mvc/searchmanager",
     "splunkjs/ready!",
     "splunkjs/mvc/simplexml/ready!"    
     ],
     function(
         mvc,
         TokenUtils,
         $,
         SearchManager
         ) {
             //jQuery to access Panel with ID and use mvc.Components.get() function to get all Submitted Tokens.
             //On mouseover() event set the show token for the Tooltip
             $('#panel1').on("mouseover",function(){
                 var tokens = mvc.Components.get("submitted");
                 tokens.set("tokToolTipShow1", "true");
             });
             //On mouseout() event unset the show token for the Tooltip to hide the same.
             $('#panel1').on("mouseout",function(){
                 var tokens = mvc.Components.get("submitted");        
                 tokens.unset("tokToolTipShow1");
              });

          $('#panel2').on("mouseover",function(){
              var tokens = mvc.Components.get("submitted");
              tokens.set("tokToolTipShow2", "true");
          });

          //On mouseout() event unset the show token for the Tooltip to hide the same.
          $('#panel2').on("mouseout",function(){
              var tokens = mvc.Components.get("submitted");        
              tokens.unset("tokToolTipShow2");
          });

          $('#panel3').on("mouseover",function(){
              var tokens = mvc.Components.get("submitted");
              tokens.set("tokToolTipShow3", "true");
          });

          //On mouseout() event unset the show token for the Tooltip to hide the same.
          $('#panel3').on("mouseout",function(){
              var tokens = mvc.Components.get("submitted");        
              tokens.unset("tokToolTipShow3");
          });

          $('#panel4').on("mouseover",function(){
              var tokens = mvc.Components.get("submitted");
              tokens.set("tokToolTipShow4", "true");
          });

          //On mouseout() event unset the show token for the Tooltip to hide the same.
          $('#panel4').on("mouseout",function(){
              var tokens = mvc.Components.get("submitted");        
              tokens.unset("tokToolTipShow4");
          });
      }
 );
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I am adding HTML code for each panel using the token from javascript.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 23:13:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-java-script-used-for-tooltip/m-p/394635#M25819</guid>
      <dc:creator>satyaallaparthi</dc:creator>
      <dc:date>2019-05-29T23:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with java script used for tooltip</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-java-script-used-for-tooltip/m-p/394636#M25820</link>
      <description>&lt;P&gt;require([&lt;BR /&gt;
     "splunkjs/mvc",&lt;BR /&gt;
     "splunkjs/mvc/tokenutils",&lt;BR /&gt;
     "jquery",&lt;BR /&gt;
     "splunkjs/mvc/searchmanager",&lt;BR /&gt;
     "splunkjs/ready!",&lt;BR /&gt;
     "splunkjs/mvc/simplexml/ready!"&lt;BR /&gt;&lt;BR /&gt;
     ],&lt;BR /&gt;
     function(&lt;BR /&gt;
         mvc,&lt;BR /&gt;
         TokenUtils,&lt;BR /&gt;
         $,&lt;BR /&gt;
         SearchManager&lt;BR /&gt;
         ) {&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    function setDelegate(panel, toolTip){

             $(panel).on("mouseover",function(){  
        var tokens = mvc.Components.get("submitted");   
                tokens.set(toolTip,"true");
             });

             //On mouseout() event unset the show token for the Tooltip to hide the same.
             $(panel).on("mouseout",function(){
                var tokens = mvc.Components.get("submitted");   
        tokens.unset(toolTip);
             });

        }

         //jQuery to access Panel with ID and use mvc.Components.get() function to get all Submitted Tokens.
         //On mouseover() event set the show token for the Tooltip

     console.log("loop tokens - function delegation, starting loop");
     for(i=1;i&amp;lt;50;i++)
         { 
         var p = "#panel" + i;
         var ttp = "tokToolTipShow" + i;
         setDelegate(p, ttp);   
     }


     }
 );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jun 2019 16:13:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-java-script-used-for-tooltip/m-p/394636#M25820</guid>
      <dc:creator>satyaallaparthi</dc:creator>
      <dc:date>2019-06-10T16:13:31Z</dc:date>
    </item>
  </channel>
</rss>

