I have added an extra menu item to the Export button, which I want to use for exporting to Excel. My problem is how I hook a GWT method to the onclick method of the menu item. I have tried:
setOption("onclick", "window.alert('test')");
(here Im just trying to show an alert, but I want to call a GWT method)
but im getting an error that says:
Uncaught JavaScript exception [TypeError: a.onclick.apply is not a function]...
which means that Im not using the right syntax to add the callback method. Anyone suggestions?
Thanks :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately, I don't believe GWT Highcharts would currently support the ability to hook up a custom event handler when the "Export" button is clicked. It's on the TODO list, so if anyone would like to contribute - please let me know! Essentially, the "Exporting" Java type needs to support the Highcharts "buttons" configuration option, and then custom event handlers need to be wired up to the "exporting.buttons.exportButton.onclick" option.
In the meantime, you'd either need to wire this up on your own (likely using a scheduledDeferred) to wire your own event into the DOM element with id "exportButton", or customize "BaseChart.java" to support this in the "nativeRenderChart()" method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have added an extra menu item to the Export button, which I want to use for exporting to Excel. My problem is how I hook a GWT method to the onclick method of the menu item. I have tried:
setOption("onclick", "window.alert('test')");
(here Im just trying to show an alert, but I want to call a GWT method)
but im getting an error that says:
Uncaught JavaScript exception [TypeError: a.onclick.apply is not a function]...
which means that Im not using the right syntax to add the callback method. Anyone suggestions?
Thanks :)
Unfortunately, I don't believe GWT Highcharts would currently support the ability to hook up a custom event handler when the "Export" button is clicked. It's on the TODO list, so if anyone would like to contribute - please let me know! Essentially, the "Exporting" Java type needs to support the Highcharts "buttons" configuration option, and then custom event handlers need to be wired up to the "exporting.buttons.exportButton.onclick" option.
In the meantime, you'd either need to wire this up on your own (likely using a scheduledDeferred) to wire your own event into the DOM element with id "exportButton", or customize "BaseChart.java" to support this in the "nativeRenderChart()" method.