<?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 to get the clicked value using javascript in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102599#M182995</link>
    <description>&lt;P&gt;No I am not using any drill down here.Iam using javascript code to get the value in message box.&lt;/P&gt;

&lt;P&gt;I found there is a possibilty to get the clicked value in message box.&lt;/P&gt;

&lt;P&gt;The above table shows a and link columns.Iam displaying that using simpleresultstable module.When i click any cell value(second column cell value) it loads application.js file and after executing the script it shows the first column cell value only.But I want to get the link value say that(&lt;A href="http://someurl"&gt;http://someurl&lt;/A&gt;).&lt;/P&gt;</description>
    <pubDate>Thu, 25 Oct 2012 10:15:26 GMT</pubDate>
    <dc:creator>madanashok</dc:creator>
    <dc:date>2012-10-25T10:15:26Z</dc:date>
    <item>
      <title>How to get the clicked value using javascript</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102597#M182993</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Iam using simpleresultstable module with pager to show results like below.&lt;/P&gt;

&lt;P&gt;a          link&lt;/P&gt;

&lt;P&gt;View       &lt;A href="http://www.some"&gt;http://www.some&lt;/A&gt; url&lt;BR /&gt;
View       &lt;A href="http://www.some"&gt;http://www.some&lt;/A&gt; url&lt;BR /&gt;
View       &lt;A href="http://www.some"&gt;http://www.some&lt;/A&gt; url&lt;/P&gt;

&lt;P&gt;Now in application.js i use this following code to show the value when clicked.&lt;/P&gt;

&lt;P&gt;switch (Splunk.util.getCurrentView()) {&lt;BR /&gt;
    case "dd1":&lt;BR /&gt;
        if (Splunk.Module.NullModule) {&lt;BR /&gt;
            Splunk.Module.NullModule = $.klass(Splunk.Module.NullModule, {&lt;BR /&gt;
                getModifiedContext: function() {&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;             var name = this.getContext().get("click.name");

               var val = this.getContext().get("click.value");
                 if (name == "a") {
                               alert(val);
              }
                return context;
            }
        });
    }
    break;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;when i click the table it shows only the first column value in message box.&lt;/P&gt;

&lt;P&gt;I want to get the clicked value in MessageBox.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 08:50:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102597#M182993</guid>
      <dc:creator>madanashok</dc:creator>
      <dc:date>2012-10-25T08:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the clicked value using javascript</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102598#M182994</link>
      <description>&lt;P&gt;What kind of drilldown are you using, row or all? You need to have drilldown set to &lt;CODE&gt;all&lt;/CODE&gt; in your SimpleResultsTable module and then use the variable &lt;CODE&gt;click.value2&lt;/CODE&gt; to get the contents of the specific cell that is clicked. &lt;CODE&gt;click.value&lt;/CODE&gt; just gives you the value of the first cell in the row clicked.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/AdvancedDev/TableChartDrilldown"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/AdvancedDev/TableChartDrilldown&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 09:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102598#M182994</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-25T09:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the clicked value using javascript</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102599#M182995</link>
      <description>&lt;P&gt;No I am not using any drill down here.Iam using javascript code to get the value in message box.&lt;/P&gt;

&lt;P&gt;I found there is a possibilty to get the clicked value in message box.&lt;/P&gt;

&lt;P&gt;The above table shows a and link columns.Iam displaying that using simpleresultstable module.When i click any cell value(second column cell value) it loads application.js file and after executing the script it shows the first column cell value only.But I want to get the link value say that(&lt;A href="http://someurl"&gt;http://someurl&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 10:15:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102599#M182995</guid>
      <dc:creator>madanashok</dc:creator>
      <dc:date>2012-10-25T10:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the clicked value using javascript</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102600#M182996</link>
      <description>&lt;P&gt;Jquery, which is built into Splunk, could be used. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CC8QFjAA&amp;amp;url=http%3A%2F%2Fapi.jquery.com%2Flive%2F&amp;amp;ei=WYr6Ud_LFIbvqwGh4IHADw&amp;amp;usg=AFQjCNHPnKvzKaTw54m1H-YHMmd8NEWjTQ&amp;amp;sig2=8AozBXoUQ8Ju-vsR2-q8Bw&amp;amp;bvm=bv.50165853,d.aWM"&gt;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CC8QFjAA&amp;amp;url=http%3A%2F%2Fapi.jquery.com%2Flive%2F&amp;amp;ei=WYr6Ud_LFIbvqwGh4IHADw&amp;amp;usg=AFQjCNHPnKvzKaTw54m1H-YHMmd8NEWjTQ&amp;amp;sig2=8AozBXoUQ8Ju-vsR2-q8Bw&amp;amp;bvm=bv.50165853,d.aWM&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;(the .live has been replaced with .on in the current version of Jquery, but Splunk is using version 1.6, so .live will work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if (Splunk.util.getCurrentView() == 'your_view_name' ) {

   $(".myButtonClass").live("click", function(event){
   event.preventDefault(); 
   var txt = $(this).text();
   var url = $(this).url();
   alert(txt);
   alert(url);
   });
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Aug 2013 16:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-clicked-value-using-javascript/m-p/102600#M182996</guid>
      <dc:creator>joelzyla</dc:creator>
      <dc:date>2013-08-01T16:26:59Z</dc:date>
    </item>
  </channel>
</rss>

