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 the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...