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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...