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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...