PDA

View Full Version : Export Ext.Grid data in CSV (not Excel)



Sam007
1 Nov 2012, 9:36 AM
I am trying to export the Ext.grid data in the CSV format using Ext.ux.Exporter. Can somebody give me an example as to how I can achieve doing it successfully?

I added the


<script src="../Exporter-all.js" type="text/javascript"></script>

which I got from the Ed github.


var exportCSV = new Ext.ux.Exporter.Button({
component: grid,
text: 'Download CSV'
});


Now I located the new source https://code.google.com/p/geoext-viewer/source/browse/trunk/heron/lib/ext.ux/Exporter-all.js?r=557 but not sure why I keep getting,

Heron is not defined

in the console, in line 179. Any idea how I can resolve that?

mitchellsimoens
5 Nov 2012, 5:49 AM
Line 179 uses the heron namespace. Looks like you need to include other JS files.

Sam007
5 Nov 2012, 10:07 AM
Thanks for the reply @mitchellsimoens (http://www.sencha.com/forum/member.php?22216-mitchellsimoens). I was able to add,


<script src="../heron-0.70/lib/ext.ux/Exporter-all.js" type="text/javascript"></script>
<script src="../heron-0.70/script/Heron.js" type="text/javascript"></script>




And I can now download the data, but it is downloaded as text file not CSV. Where do I need the correction?

mitchellsimoens
5 Nov 2012, 10:38 AM
You would have to ask the author about that