How can I access "HTML 5 data export" functionality via javascript?
How can I access "HTML 5 data export" functionality via javascript?
stergios
Posts: 12Questions: 2Answers: 0
Description of problem:
Hi,
The "HTML 5 data export" via the Buttons extension works great for me. However, I prefer not to have the buttons displayed at all, and instead access the functionality through other means in my GUI.
Can someone point me in the right direction how I may achieve this?
Thanks,
Stergios
This question has accepted answers - jump to:
This discussion has been closed.
Answers
One way is to create hidden buttons and use
button().trigger()
to trigger the button you want. You can use the Direct Insertion method into a hiddendiv
.There maybe other ways for this.
Kevin
Hey, that worked well. I have not hidden the buttons yet, but I did get them to work via other elements from within my GUI.
At first I used:
But after your suggestion I switched to:
Thanks for the guidance,
Stergios
As a follow up comment, I successfully have hidden the buttons with the export functionality intact and working as I access it from other parts of my GUI.
However, I am confused by the example code. Is the 2nd argument in the call to the jQuery function '$()' in the Direct Insertion method necessary? Here's the example repeated:
What is the purpose of this argument:
in the call to the Selector function '$()'
I ignored using the 2nd argument in my own code with no apparent problems.
Thanks,
Stergios
It just makes the selector more specific, but if it works without - go for it
Colin
I see. I'm so used to calling the selector function with multiple arguments in just one string such as
I did not think about passing it multiple arguments, possibly as objects, to do the same. I learned something new!
Again, thanks for the help!
Stergios