Dashboards & Visualizations

I would like to make table_row_highlighting.js loaded automatically.

Shuhei052492
Path Finder

Hi,

I have copied the "table_row_highlighting.js" and "table_decorations.css" in Splunk DashBoard Example and created new ones.
After that the javascript and css looks fine. And table row color and font are changed depending on the key value.

However the only table row color is not changed with the following situation although the table value font is changed.
1. open this dashboard first time.
2. do not change the input panel value.
3. drilldown to this dashboard.

After I do the above thing, table row color is changed.

I am thinking that there is a cause to happen this issue in the lines.
###Original JS###

   mvc.Components.get('colortable').getVisualization(function(tableView) {
        tableView.on('rendered', function() {
            //Apply class of the cells to the parent row in order to color the whole row
                        tableView.$el.find('td.range-cell').each(function() {
            $(this).parents('tr').addClass(this.className);
            });
              });
            //Add custom cell renderer, the table will re-render automatically.
            tableView.addCellRenderer(new CustomRangeRenderer());
        });
});

###myJS###

    mvc.Components.get('colortable').getVisualization(function(tableView) {
        // Add custom cell renderer
       tableView.table.addCellRenderer(new CustomRangeRenderer());
        tableView.on('rendered', function() {
            // Apply class of the cells to the parent row in order to color the whole row
            tableView.$el.find('td.range-cell').each(function() {
                  $(this).parents('tr').addClass(this.className);
           });
         // Force the table to re-render
            tableView.table.render();
        });
     });
 });

Does anyone have an idea or advice to solve it?
I appreciate any ideas and advices.

Best regards,

0 Karma
1 Solution

Shuhei052492
Path Finder
0 Karma

Shuhei052492
Path Finder

Hi,
This myJs is working in splunk 6.6.3!
But I would like to let it work in 7.1.3.
Does anyone have another idea?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...