You cannot save a file, or set a file download from JavaScript, so it's not possible to do directly.
But, if you use the table for editing, you can export the data (http://javascriptools.sourceforge.net/docs/manual/JavaScripTable_data.html) to a hidden form field and the submit it to the server. On the server application, you may create a download by writing the content of that field back to the response and setting the http headers Content-Type:text/csv and Content-Disposition:attachment;filename=file.csv
That would be an extra roundtrip, but I cannot think another way to do it...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello evetybody!!
I would like if someone here has a idea or to know a way to export the data of a JSTable to Excel or to a text-file.
Some one here can help me??
thank's a lot!!
You cannot save a file, or set a file download from JavaScript, so it's not possible to do directly.
But, if you use the table for editing, you can export the data (http://javascriptools.sourceforge.net/docs/manual/JavaScripTable_data.html) to a hidden form field and the submit it to the server. On the server application, you may create a download by writing the content of that field back to the response and setting the http headers Content-Type:text/csv and Content-Disposition:attachment;filename=file.csv
That would be an extra roundtrip, but I cannot think another way to do it...