Dashboards & Visualizations

Application.js jquery to customize table SimpleResultsTable

SplunkyMonkey
Engager

Hi,

I'm attempting to modify cells in a table based on a condition.

Currently I have the following, which doesn't work:

if (Splunk.util.getCurrentView() == 'myView' ) {
$(document).ready( function() {
$('.SimpleResultsTable td').css('background-color', '#ffff00');
});
}

The above code does work to turn the entire table yellow when I replace "SimpleResultsTable td" with "SimpleResultsTable".

So, why can't I change the background of a cell(td)? I have also attempted a row(tr).

My theory is that because all of these tables say "loading" for several seconds, my javascript is firing before these table elements exist. In fact, if I inspect the code before the tables have loaded, I can see the SimpleResultsTable div is empty.

Can anyone suggest a way to accomplish this?

Thanks!

1 Solution

jonuwz
Influencer

Swap out $(documnet).ready for $(document).ajaxComplete

View solution in original post

jonuwz
Influencer

Swap out $(documnet).ready for $(document).ajaxComplete

SplunkyMonkey
Engager

Thanks, worked!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...