<?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: Hide custom named column from SimpleResultsTable in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105105#M27260</link>
    <description>&lt;P&gt;Hi Sideview,&lt;/P&gt;

&lt;P&gt;the problem is we developed a custom SimpleResultsTable to be able to add CSS classes to specific columns (as you can see, we have "semaphores" images in the "status" column).&lt;BR /&gt;
Would your table module also be able to do so?&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2013 06:52:35 GMT</pubDate>
    <dc:creator>stefano_guidoba</dc:creator>
    <dc:date>2013-07-25T06:52:35Z</dc:date>
    <item>
      <title>Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105099#M27254</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;we're trying to use a little piece of JavaScript (put in application.js) to perform column hiding for SimpleResultsTable in a dashboard.&lt;BR /&gt;
Here's the code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if(Splunk.Module.GraphicResultsTable) {
var orig = Splunk.Module.GraphicResultsTable.prototype.onResultsRendered;
Splunk.Module.GraphicResultsTable.prototype.onResultsRendered = function() {
    var elements = [];
    orig.call(this);
    $('th', this.container).each(function(i, el) {
        if(/^.*_hide\s*$/.test($(el).text())) {
            elements.push($(el).text());
            $(el).hide();
        }
    });

    for(n = 0; n &amp;lt; elements.length; n++) {
        $("td[field|='" + elements[n] + "']", this.container).hide();
    }

}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;As you can see, we're trying to tell Splunk, when building HTML table, to hide column headers and cells which are named &lt;SOMETHING&gt;_hide. With this piece of code everything works fine for a single column. When trying to put 2 columns in our SimpleResultsTable, the thing happening is that all "th" involved are correctly hidden, while only the first "td" is hidden, leaving the second perfectly visible (see the image attached, where we would want the column with "B24A" and "B24H" hidden)&lt;BR /&gt;
&lt;IMG src="http://splunk-base.splunk.com//storage/ScreenShot001_1.bmp" alt="HTML wrong" /&gt;&lt;/SOMETHING&gt;&lt;/P&gt;

&lt;P&gt;I've checked the HTML/CSS generated, and have seen that for the column not hidden there's not the same CSS class as for the hidden one, but I have no idea how to change my JS to fix this (not a big expert of JS &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ).&lt;/P&gt;

&lt;P&gt;Any suggestion would be very helpful!&lt;/P&gt;

&lt;P&gt;P.S.1: I took JS template code from Ziegfried in this answer &lt;A href="http://splunk-base.splunk.com/answers/47218/remove-_raw-field-from-table-view"&gt;Remove _raw field from table view&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;P.S.2: as one might notice, my JS refers to a GraphicResultsTable, which is a custom module made by a colleague for custom SimpleResultsTable where it's possible to add custom CSS classes via Splunk&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 09:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105099#M27254</guid>
      <dc:creator>stefano_guidoba</dc:creator>
      <dc:date>2013-07-24T09:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105100#M27255</link>
      <description>&lt;P&gt;I think  the first block missed the for loop, so only one header is getting hidden.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 09:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105100#M27255</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-07-24T09:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105101#M27256</link>
      <description>&lt;P&gt;Hi Linu,&lt;BR /&gt;
as you can see headers are correctly hidden (I put two columns named interface_hide and procedure_hide, and they are not shown). The problem is the cells of procedure_hide column are not hidden (second column).&lt;BR /&gt;
I'm not using a "for" for headers because it uses a foreach &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105101#M27256</guid>
      <dc:creator>stefano_guidoba</dc:creator>
      <dc:date>2020-09-28T14:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105102#M27257</link>
      <description>&lt;P&gt;I am not familiar with java script programming as well. But if you hide the filed doesn't mean the field is not there is the resultset, hence relevant column values shows up!! But I may sound stupid for my analysis.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 09:43:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105102#M27257</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-07-24T09:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105103#M27258</link>
      <description>&lt;P&gt;But I do want to have it in the results set, because I'm using it for dashboard drilldown &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; My only concern is to not show it.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 09:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105103#M27258</guid>
      <dc:creator>stefano_guidoba</dc:creator>
      <dc:date>2013-07-24T09:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105104#M27259</link>
      <description>&lt;P&gt;You should take a look at the Table module in Sideview Utils 2.X.  The Table module is very widely used, and it has a "hiddenFields" param.  When you specify fields in that param, they will not be visible in the rendered Table, but they &lt;EM&gt;will&lt;/EM&gt; be available for all drilldown searches and drilldown logic.   &lt;A href="http://sideviewapps.com/apps/sideview-utils"&gt;http://sideviewapps.com/apps/sideview-utils&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 06:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105104#M27259</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-07-25T06:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105105#M27260</link>
      <description>&lt;P&gt;Hi Sideview,&lt;/P&gt;

&lt;P&gt;the problem is we developed a custom SimpleResultsTable to be able to add CSS classes to specific columns (as you can see, we have "semaphores" images in the "status" column).&lt;BR /&gt;
Would your table module also be able to do so?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 06:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105105#M27260</guid>
      <dc:creator>stefano_guidoba</dc:creator>
      <dc:date>2013-07-25T06:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Hide custom named column from SimpleResultsTable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105106#M27261</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;found the solution, provided below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if(Splunk.Module.GraphicResultsTable) {
var orig = Splunk.Module.GraphicResultsTable.prototype.onResultsRendered;
Splunk.Module.GraphicResultsTable.prototype.onResultsRendered = function() {
    var elements = [];
    orig.call(this);
    $('th', this.container).each(function(i, el) {
        if(/^.*_hide\s*$/.test($(el).text())) {
            elements.push($(el).text());
            $(el).hide();
        }
    });

    for(n = 0; n &amp;lt; elements.length; n++) {
        $("td[field|=" + elements[n].trim() + "]", this.container).hide();
    }

}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;It should also work with SimpleResultsTable.&lt;BR /&gt;
Enjoy!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 13:34:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hide-custom-named-column-from-SimpleResultsTable/m-p/105106#M27261</guid>
      <dc:creator>stefano_guidoba</dc:creator>
      <dc:date>2013-07-25T13:34:36Z</dc:date>
    </item>
  </channel>
</rss>

