JavaScript Is there a way to pass in variable element ID from Highcharts to launch a modal window?

I am trying to pass in variable elementIDs from HighCharts label elements into a javascript function, using these I would like to launch the required divs in a jquery modal window.

I have my example code here: http://jsfiddle.net/k4LLM/27/

function ShowTable(TableID)
{
var ID = TableID;
$("#TableID").dialog({
        autoOpen: false,
        draggable: false,
        minWidth: 700,
        show: {
            effect: "fade",
            duration: 1000
        },
        hide: {
            effect: "fade",
            duration: 1000
        },
        position: {
            my: "center",
            at: "center",
            of: window
        },
        close: function (event, ui) {},
    });

$("#TableID").dialog("open");
}
$(document).ready(function () {
    $('#Graph').highcharts({
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false
    },
    title: {
        text: 'Test Title'
    },
    tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            point: {
                events: {
                    click: function(event) {
                        var options = this.options;
                        var str = options.name.split(" ");
                        ShowTable('DataToShow' + str[1]);
                    }
                }
            },
            dataLabels: {
                enabled: true,
                color: '#000000',
                connectorColor: '#000000',
                formatter: function() {
                    return '<b>' + this.point.name + '</b>:' + this.point.y;
                }
            }
        }
    },
    series: [{
        type: 'pie',
        name: 'Calls Assigned',
        data: [
            ['Item 1', 0],
            ['Item 2', 0],
            ['Item 3', 1],
            ['Item 4', 0],
            ['Item 5+', 0], ]
    }]
});
});

The issue I have is, TableID does not seem to work in the ShowTable Function - the variable get defined correctly, and the modal windows works if you manually add the correct div ID, but does not work when the div id is passed in via the HighCharts OnClick event

Any help would be appreciated

Answer:1

I have a ReactJS project where i get JSON from REST Django host and creating a table with filters for it. I have a Table class : class MainTable extends React.Component { constructor(props) { ...

I have a ReactJS project where i get JSON from REST Django host and creating a table with filters for it. I have a Table class : class MainTable extends React.Component { constructor(props) { ...

  1. react mount component only once

I am trying to change the icon on collapse and facing an event firing issue The HTML <div id="collapse-menu" class="row"> <div class=" panel"> <a href="#...

I am trying to change the icon on collapse and facing an event firing issue The HTML <div id="collapse-menu" class="row"> <div class=" panel"> <a href="#...

  1. bootstrap collapse event handler
  2. bootstrap collapse event not firing
  3. bootstrap collapse event angular
  4. bootstrap collapse event listener
  5. bootstrap collapse event
  6. bootstrap collapse event example
  7. bootstrap collapse event not working
  8. bootstrap collapse event get element
  9. bootstrap collapse event show
  10. bootstrap 4 collapse event
  11. bootstrap 3 collapse event
  12. bootstrap panel collapse event
  13. bootstrap accordion collapse event
  14. bootstrap collapse click event
  15. bootstrap navbar collapse event
  16. bootstrap collapse javascript event
  17. bootstrap after collapse event
  18. bootstrap collapse open event
  19. bootstrap data-toggle collapse event
  20. vue bootstrap collapse event

I want to get all selected values of bootstrap-multiselect on button click. My JSP page code is given below <script type="text/javascript"> $(document).ready(function() { $('#...

I want to get all selected values of bootstrap-multiselect on button click. My JSP page code is given below <script type="text/javascript"> $(document).ready(function() { $('#...

  1. javascript bootstrap multiselect
  2. javascript multiselect bootstrap
  3. js bootstrap multiselect
  4. vue js bootstrap multiselect
  5. js/bootstrap-multiselect.js download
  6. js/bootstrap-multiselect.js cdn
  7. angularjs bootstrap multiselect
  8. angularjs bootstrap multiselect dropdown

I have an attribute that is of string data type.I am using the algoliasearchHelper object to search through my Algolia database. What I want to do is create a facet filter that takes a specified ...

I have an attribute that is of string data type.I am using the algoliasearchHelper object to search through my Algolia database. What I want to do is create a facet filter that takes a specified ...