Dashboards & Visualizations

Token manipulation from JS

apezuela
Explorer

Hi,

I am trying to manipulate a token from JS (there is not drilldown in "Status indicator" panel.

The idea is show the second panel when the user press over the first status indicator panel(panel_1). I am using the token "$show_listado_usuarios$">

Relevant code in xmlsimple is:

 </panel>
    <panel id="panel_1">
      <title>PANEL 1</title>
      <viz type="status_indicator_app.status_indicator">
        <title>......</title>
        <search>
          <query>|...... </query>
        </search>
        <option name="drilldown">all</option>
        <option name="height">63</option>
        <option name="refresh.display">progressbar</option>
        <option name="status_indicator_app.status_indicator.colorBy">static_color</option>
        <option name="status_indicator_app.status_indicator.fillTarget">text</option>
        <option name="status_indicator_app.status_indicator.fixIcon">users</option>
        <option name="status_indicator_app.status_indicator.icon">fix_icon</option>
        <option name="status_indicator_app.status_indicator.precision">0</option>
        <option name="status_indicator_app.status_indicator.showOption">1</option>
        <option name="status_indicator_app.status_indicator.staticColor">#555</option>
        <option name="status_indicator_app.status_indicator.useColors">true</option>
        <option name="status_indicator_app.status_indicator.useThousandSeparator">true</option>

      </viz>
    </panel>
    <panel id="panel_2" depends="$show_listado_usuarios$">
      <title>PANEL 2</title>
      <table>
        <search> .....

The code for change the token value to true is:

   // Components to
require
     var components = [
         "splunkjs/ready!",
         "splunkjs/mvc/simplexml/ready!",
         "jquery"
     ];

     // Require the components
     require(components, function(
         mvc,
         ignored,
         $
     ) {
         $('#panel_1').click(function() {
                var tokens = mvc.Components.get("default");
                tokens.set("form.show_listado_usuarios","true");
         });

Any idea of why is not working?

Best regards,

Tags (1)
0 Karma

apezuela
Explorer

If in the place of change a token, the app open a new window there is not problem. I follow the guide: http://dev.splunk.com/view/webframework-developapps/SP-CAAAEW3

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...