<?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: Rangemap cell formatting for multiple tables in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218484#M64200</link>
    <description>&lt;P&gt;Well, I guess I wasn't ready to quit and found my problem when making multiple "table1" or "highlight" code entries for the different tables.&lt;/P&gt;

&lt;P&gt;Main Answer: I didn't update the table_cell_highlighting.css with the new .css entries to correspond with "id=highlight1", id="highlight2", id="highlight3".  Now it has extra entries like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#highlight2 td.range-elevated {
    background-color: #ffc57a !important;
    font-weight: bold;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also chose to simply make three copies of the .js file, so it looks like this in the XML:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_cell_highlighting1.js,table_cell_highlighting2.js,table_cell_highlighting3.js" stylesheet="table_cell_highlighting.css"&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And each .js file has the edits:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;return _(['Avg Network Delta', 'Availability']).contains(cell.field);
if (cell.field === 'Avg Network Delta')
if (cell.field === 'Availability')
mvc.Components.get('highlight1') 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;[and highlight2 for the next .js file, highlight3 for the .js file after that]&lt;/P&gt;

&lt;P&gt;Screenshot of finished outcome.&lt;/P&gt;

&lt;P&gt;If you have a different solution, let me know!&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/59235-rangemap-multiple-tables-and-cells-solution01.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:14:33 GMT</pubDate>
    <dc:creator>aarontimko</dc:creator>
    <dc:date>2020-09-29T07:14:33Z</dc:date>
    <item>
      <title>Rangemap cell formatting for multiple tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218483#M64199</link>
      <description>&lt;P&gt;I am trying to make a simple NOC dashboard which has value-based cell formatting for multiples tables.&lt;BR /&gt;
(Before going further... I put 'rangemap' in the title, but I don't think that's going to be the answer)&lt;/P&gt;

&lt;P&gt;Each table will have the same search, but different timeframes (the uploaded picture may help).&lt;/P&gt;

&lt;P&gt;I've used the single_decorations.css icons before with a rangemap, but now I'm looking to do cell formatting because the icons will take up too much space.&lt;BR /&gt;
I looked into the other Dashboard Examples and have successfully tested with table_icons_inline.js and table_cell_highlighting.js.&lt;/P&gt;

&lt;P&gt;The problem with both of those, however, is that they both reference the page element by name:&lt;BR /&gt;
&lt;CODE&gt;mvc.Components.get('table1')&lt;/CODE&gt; or &lt;CODE&gt;mvc.Components.get('highlight')&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;For this dashboard, there are going to be three tables.&lt;/P&gt;

&lt;P&gt;I tried copying the table1 code into identical code for get('table2') and get('table3') but couldn't get it to work.&lt;/P&gt;

&lt;P&gt;Also, each table is probably going to need different rangemap thresholds because it's averaging over different time periods.&lt;BR /&gt;
So then it looks like I'm perhaps making three different .js files, one for each table?&lt;/P&gt;

&lt;P&gt;Any thoughts would be great.&lt;/P&gt;

&lt;P&gt;Again, I don't think I can do this with a rangemap because of everything going on in this dashboard.&lt;BR /&gt;
But... a rangemap would make it easier for defining thresholds (instead of them being defined in the .js).&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/59233-rangemap-multiple-tables-and-cells.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:14:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218483#M64199</guid>
      <dc:creator>aarontimko</dc:creator>
      <dc:date>2020-09-29T07:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rangemap cell formatting for multiple tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218484#M64200</link>
      <description>&lt;P&gt;Well, I guess I wasn't ready to quit and found my problem when making multiple "table1" or "highlight" code entries for the different tables.&lt;/P&gt;

&lt;P&gt;Main Answer: I didn't update the table_cell_highlighting.css with the new .css entries to correspond with "id=highlight1", id="highlight2", id="highlight3".  Now it has extra entries like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#highlight2 td.range-elevated {
    background-color: #ffc57a !important;
    font-weight: bold;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also chose to simply make three copies of the .js file, so it looks like this in the XML:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_cell_highlighting1.js,table_cell_highlighting2.js,table_cell_highlighting3.js" stylesheet="table_cell_highlighting.css"&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And each .js file has the edits:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;return _(['Avg Network Delta', 'Availability']).contains(cell.field);
if (cell.field === 'Avg Network Delta')
if (cell.field === 'Availability')
mvc.Components.get('highlight1') 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;[and highlight2 for the next .js file, highlight3 for the .js file after that]&lt;/P&gt;

&lt;P&gt;Screenshot of finished outcome.&lt;/P&gt;

&lt;P&gt;If you have a different solution, let me know!&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/59235-rangemap-multiple-tables-and-cells-solution01.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:14:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218484#M64200</guid>
      <dc:creator>aarontimko</dc:creator>
      <dc:date>2020-09-29T07:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rangemap cell formatting for multiple tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218485#M64201</link>
      <description>&lt;P&gt;&lt;CODE&gt;rangemap&lt;/CODE&gt; is indeed the answer here. You can use the icon approach as well, just adjust it to fit the table. For Example, make the height of the severe 15px in the &lt;CODE&gt;single_decorations.css&lt;/CODE&gt; file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.severe {
     height: 15px;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want it to be highlighted, still use &lt;CODE&gt;rangemap&lt;/CODE&gt; and use a custom table renderer. The documentation is here: &lt;A href="http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEVM"&gt;http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEVM&lt;/A&gt; . Add that into the &lt;CODE&gt;dashboard.js&lt;/CODE&gt; (only the javascript in the block js section - don't add the django). For each table, do the &lt;CODE&gt;mvc.Components.get("table1")&lt;/CODE&gt; call, but assign the custom renderer.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var table1 = mvc.Components.get("table1");
table1.addCellRenderer(myCellRenderer);  
table1.render();
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Sep 2015 11:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218485#M64201</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-09-10T11:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rangemap cell formatting for multiple tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218486#M64202</link>
      <description>&lt;P&gt;Thank you, I hadn't found that particular code example.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 18:27:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218486#M64202</guid>
      <dc:creator>aarontimko</dc:creator>
      <dc:date>2015-09-10T18:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rangemap cell formatting for multiple tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218487#M64203</link>
      <description>&lt;P&gt;Great answer!  I have two rangemaps in a panel in two different tables and could not get the second one to populate!  I went with row highlighting and still couldn't get it to populate the second table.  &lt;/P&gt;

&lt;P&gt;I was adding a second &lt;BR /&gt;
       mvc.Components.get('table2').getVisualization(function(tableView){...}&lt;/P&gt;

&lt;P&gt;to the .js file but it wouldn't work.&lt;/P&gt;

&lt;P&gt;However, after creating two .js files, one for each table it's finally working!  Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 21:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rangemap-cell-formatting-for-multiple-tables/m-p/218487#M64203</guid>
      <dc:creator>cpt12tech</dc:creator>
      <dc:date>2017-03-21T21:52:14Z</dc:date>
    </item>
  </channel>
</rss>

