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!

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 ...