Hi all,
I found this great blog by infragistics on including igGrid with Durandal 2 support.
http://es.infragistics.com/community/blogs/pivanov/archive/2014/09/16/adding-iggrid-in-durandal-2.aspx
How would I do an excel export with Durandal 2? Is there an example for this?
All the examples I find for excel are using something like the following:
<script id = "exportGrid"> function exportGrid() { $.ig.GridExcelExporter.export($("#grid"), { fileName: "igGrid" }); }; </script>
This however does not seem to work using Durandal 2.
Any reference materials, sample project, or examples on how this works? I looked over the iggrid documentation without much success to find other approaches.
Thanks,
Hi,
Thank you for posting in the Infragistics community ! I am currently working onto your issue and will update you with my findings.
Basically the igGridExcelExporter needs its resources to be loaded in order to work and anything else. However I have been trying to export the grid in a Durandal 2 app and did not succeed so far. I have been working with the sample shared at http://es.infragistics.com/community/blogs/pivanov/archive/2014/09/16/adding-iggrid-in-durandal-2.aspx
What I did is:
1) added the required js resources inside the lib/infragistics folder. Required resources are the following: (you can download them from the below links and place them in the lib/infragistics folder):
<script src="http://cdn-na.infragistics.com/igniteui/2015.1/latest/js/modules/infragistics.documents.core.js"></script><script src="http://cdn-na.infragistics.com/igniteui/2015.1/latest/js/modules/infragistics.excel.js"></script><script src="http://cdn-na.infragistics.com/igniteui/2015.1/latest/js/modules/infragistics.gridexcelexporter.js"></script> <script src="http://www.igniteui.com/js/external/FileSaver.js"></script><script src="http://www.igniteui.com/js/external/Blob.js"></script>
2) Placing the resources inside the define wrapper:
define(['knockout', 'jquery', 'jquery.ui', 'knockout.mapping', 'infragistics.core', 'infragistics.lob', 'infragistics.ds.knockout', 'infragistics.grid.knockout', 'infragistics.excel', 'infragistics.documents.core', 'infragistics.gridexcelexporter', 'FileSaver', 'Blob' ],
3) and also added thourgh the RequireJS:
shim: {.... 'infragistics.documents.core': { deps: ['jquery', 'jquery.ui', 'infragistics.core', 'infragistics.lob'] }, 'infragistics.gridexcelexporter': { deps: ['jquery', 'jquery.ui', 'infragistics.excel', 'infragistics.documents.core'] }, 'infragistics.excel': { deps: ['infragistics.lob'] }, }
However it seems that $.ig.excel is not available in the app for some reason and I am taking more time for investigating. However it will be helpful if you update me at that time with information on did you manage to load the resources or you are facing another issue with the exporting process. Looking forward to hearing from you.