Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get data from grid and download them like .csv file in ExtJS 4.2

I have a Ext.grid.Panel and I fill it with store that is populated from database. And there is an export button. When the user click on the Export button, I want the data from grid should start downloading like .csv file

like image 878
Dragan Menoski Avatar asked Nov 19 '25 16:11

Dragan Menoski


1 Answers

The best solution to creating any type of file (Excel, CSV, PDF, whatever) is going to be leveraging your application server to create and serve up the file for download. There are literally thousands of libraries across most of the popular server-side languages that can create just about any kind of file that you'd want to create.

So ultimately this has nothing to do with Ext JS or even JavaScript. All that your export button should do, IMO, is to create an AJAX request which triggers the process (query, transform results, publish to a correct content type, stream to browser) that will be needed to generate the content from your application server technology.

like image 159
existdissolve Avatar answered Nov 23 '25 05:11

existdissolve



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!