Button Extension: How can I request CSV from a python script?
Button Extension: How can I request CSV from a python script?
navyjosh
Posts: 2Questions: 1Answers: 0
I'm using button extensions to manually download a CSV of the datatable every time I run a script. I would really like to automatically download the csv from the script, but I don't know how to do this. Is this even possible?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It is possible to execute the export button API's from Javascript, see this discussion:
https://datatables.net/forums/discussion/32764
Depending on browser compatibility you could trigger the export API once the table is loaded using the steps above.
Executing an automatic CSV download from Python doesn't seem feasible. The Python script would need to know when the table is complete and have access to it.
Kevin
Looking at this API, how can I determine the index of the button?
I wish I could link to the datatable but unfortunately it's only available in-network.
Could you explain why you want the index of the button? I'm not sure why that information would be useful? To get it you'd need to use
button().node()
and then jQuery's$().index()
method.Allan