<?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: Table cell renderer does not work on Firefox in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472053#M33103</link>
    <description>&lt;P&gt;The issue is because JS loads before the dashboard. I found a workaround as follows.&lt;/P&gt;

&lt;P&gt;Add one line at the end of your JS.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  ...........
                  tableView.table.render();
                  // Point-B
              });
          }
      }
      setToken("wait_for_js_to_load", " ");
  });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Prepend this token in all the table queries which have custom cell renderer. Ex. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$wait_for_js_to_load$ index=main | stats count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I found this issue in Splunk 8.0.1.&lt;/P&gt;

&lt;P&gt;Hope this helps other people having same issue.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2020 11:48:45 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2020-02-14T11:48:45Z</dc:date>
    <item>
      <title>Table cell renderer does not work on Firefox</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472052#M33102</link>
      <description>&lt;P&gt;I've very similar javascript as below in my dashboard which adds up the color in the table. As I've updated dashboard.css I cannot utilize XML color palette, so I had to use table cell renderer.&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 CustomRangeRenderer = TableView.BaseCellRenderer.extend({
         canRender: function(cell) {
             // Point-C
             return _(['My Column Name', 'Name']).contains(cell.field);
         },
         render: function($td, cell) {
             // Point-D
             if(cell.value=="red" || cell.value=="green" || cell.value=="yellow")
             {
                 $td.html("&amp;lt;div class='circle_"+cell.value+"'&amp;gt;&amp;lt;/div&amp;gt;")
             }
             else if(cell.value=="NoData" || cell.value=="null")
             {
                 $td.html("&amp;lt;div class='align_center'&amp;gt;&amp;lt;/div&amp;gt;")
             }
             else
             {
                 $td.html("&amp;lt;div class='align_center'&amp;gt;"+cell.value+"&amp;lt;/div&amp;gt;")
             }
         }
     });

     //List of table IDs to add icon
     var tableIDs = ["Mytable1", "Mytable2"];
     for (i=0;i&amp;lt;tableIDs.length;i++) {
         var sh = mvc.Components.get(tableIDs[i]);
         if(typeof(sh)!="undefined") {
             sh.getVisualization(function(tableView) {
                 // Add custom cell renderer and force re-render
                // Point-A
                 tableView.table.addCellRenderer(new CustomRangeRenderer());
                 tableView.table.render();
                 // Point-B
             });
         }
     }     
 });
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My code is able to execute properly in Chrome.&lt;BR /&gt;While running in Firefox it reaches Point-A and Point-B but not to Point-C or Point-D. Any idea what can be wrong or any workaround.&lt;BR /&gt;While in Firefox also the issue is intermittent, at some random time out of two tables any one loads as well, but not all the time. Anyone have any idea why TableCellRenderer does not work in firefox sometimes?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 21:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472052#M33102</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2020-06-06T21:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Table cell renderer does not work on Firefox</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472053#M33103</link>
      <description>&lt;P&gt;The issue is because JS loads before the dashboard. I found a workaround as follows.&lt;/P&gt;

&lt;P&gt;Add one line at the end of your JS.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  ...........
                  tableView.table.render();
                  // Point-B
              });
          }
      }
      setToken("wait_for_js_to_load", " ");
  });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Prepend this token in all the table queries which have custom cell renderer. Ex. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$wait_for_js_to_load$ index=main | stats count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I found this issue in Splunk 8.0.1.&lt;/P&gt;

&lt;P&gt;Hope this helps other people having same issue.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 11:48:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472053#M33103</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2020-02-14T11:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Table cell renderer does not work on Firefox</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472054#M33104</link>
      <description>&lt;P&gt;@VatsalJagani this has been a bug in Splunk Table Cell render extension &lt;CODE&gt;since Splunk 6.6 and above&lt;/CODE&gt;. Please refer to the previous question with a workaround with setTimeout to add a delay before table is &lt;CODE&gt;rendered()&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/614788/splunk-dashboard-examples-table-row-highlighting-b.html?childToView=615859#answer-615859"&gt;https://answers.splunk.com/answers/614788/splunk-dashboard-examples-table-row-highlighting-b.html?childToView=615859#answer-615859&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 13:31:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472054#M33104</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-02-14T13:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Table cell renderer does not work on Firefox</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472055#M33105</link>
      <description>&lt;P&gt;This worked great for me. I found that I needed to use the "submitted" rather than "default" instance.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;let sub_tokens = mvc.Components.getInstance("submitted");
...
sub_tokens.set("js_ready", " ");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2020 18:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Table-cell-renderer-does-not-work-on-Firefox/m-p/472055#M33105</guid>
      <dc:creator>sreichel</dc:creator>
      <dc:date>2020-05-19T18:18:27Z</dc:date>
    </item>
  </channel>
</rss>

