Dashboards & Visualizations

How to refresh specific panel with javascript button?

sandyBDF
Engager

hi every one i try to refresh a specific panel, i follow the splunk answers but not work for me, i have a buton like this :

id="button_update" class="btn" data-set-token="run_check" data-value="true" style="background-color:#68E674;"

and search

      <query>|test.csv | stats count</query>
      <earliest>-24h@h</earliest>
      <latest>now</latest>
      <sampleRatio>1</sampleRatio>
    </search>

and javascript &colon;
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {

$(document).ready(function () {
$("button_update").on("click", function (e) {
var mySearch = mvc.Components.get("toto");
mySearch.startSearch();
});
});

});

but the search never refresh someone can help me ?

Labels (2)
0 Karma

sdhiaeddine
Explorer

Hi @sandyBDF 

Could you please share the solution, if you got one?

Thxs

0 Karma

sandyBDF
Engager

Hi, i Know that, but i want do the same thing with a visual buton not this one.

So many people succes with javascript. So i will thank people if they can put the entire code for i do the same thing.

0 Karma

493669
Super Champion

@sandyBDF, You can refresh panel by default on hovering to panel bottom left side below-
alt text

So is there any specific requirement to create button or above default refresh in panel resolves your issue.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...