Returning control through a JavaScript function

When the dashboard is embedded inside another web page, control can be passed back to the hosting application by creating a 'Drillout' component & setting its type to be 'JavaScript Function' as in the screenshot below.

dash64-1

The XML in the above screenshot is passed into the JavaScript method. The elements are:-

  • ColumnName: This is the name of the column in the dataset that was clicked to cause the drillout to be called
  • DataType: The type of the dataset column
  • ColumnID: The dashboards internal ID for the column that was clicked
  • ComponentID: The dashboards internal ID of the component that was clicked. This can be used if you have multiple components in a dashboard that are JavaScript drillouts
  • Values: This can either be a single value or a list of multiple values (comma separated) that were clicked to cause the drillout to be called.

A template function exists already in the dashboard.html file which will show a simple message showing what was clicked:-

<script type="text/javascript">
    function DashboardMethod(xml) {
         alert(xml);
    }
</script>