Visualize.js: Listen to changes with Input Controls

An event for listening to changes with JRS Input Controls.

HTML

<script src="https://mobiledemo.jaspersoft.com/jasperserver-pro/client/visualize.js"></script>

<div id="container">
  <div><p>Loading...</p></div>
</div>

<div  id="hint" >
    <span>Selection: </span>
    <strong id='output'></strong>
</div>

CSS

#container {
    width:200px;
}

#hint {
   display:none
}

/* You can replace the following with your own custom loading indicator */
@import "compass/css3";

@keyframes fadeIn { 
  from { opacity: 0; } 
}

p {
  position: relative;
  top: 50px;
  
  font: italic bold 1.2em/1 Bodoni, serif;
  color: #555;
  text-align: center;
  
  animation: fadeIn 1s infinite alternate;
}

JavaScript

visualize({
    auth: {
        name: "joeuser",
        password: "joeuser",
        organization: "organization_1"
    }
}, function (v) {
    v.inputControls({
        container: "#container",
        resource: "/public/Samples/Reports/06g.ProfitDetailReport",
        error: function (err) {
            alert(err);
        },
        events: {
            change : function(params) {
                $("#hint").show(); 
                $("#output").text(params['ProductFamily'].join(', '));
            }
        }
    });
});