Skip to content

Infragistics Community Forum / Web / Ignite UI for jQuery / Javascript Excel Exporter Issues – Uncaught TypeError: Cannot read property 'exportGrid' of undefined

Javascript Excel Exporter Issues – Uncaught TypeError: Cannot read property 'exportGrid' of undefined

New Discussion
Jeffrey
Jeffrey asked on Aug 27, 2018 6:14 AM

Hi, 

I have downloaded Infragistics Professional 2016 VOL 1,

Replaced files 1. Infragistics.core.js, dv, loader, lob

trying to export a grid gives me error Uncaught TypeError: Cannot read property 'exportGrid' of undefined

What am I missing?
 

Sign In to post a reply

Replies

  • 0
    Michael Peterson
    Michael Peterson answered on Sep 12, 2016 9:04 PM

    Hello Jeffery,

    Thank you for contacting Infragistics!

    I have some questions concerning this matter:

    1) What service release for v16.1 are you using?
    2) What version did you upgrade from?
    3) How are you setting up the grid/calling export?
    4) Do you have a sample you can attach?

    Looking forward to hearing from you.

    • 0
      Jeffrey
      Jeffrey answered on Sep 14, 2016 10:11 PM

      1) I am using version 16.1.20161.1009

      2) Upgraded from 14.2.20142.2140

      Code:

      <input type="button" id="exportButton" value="Export" />

      $("#exportButton").on("click", function () { $.ig.GridExcelExporter.exportGrid($("#grid"), { fileName: "igGrid" }); });

      $("#grid").igGrid({

      autoGenerateColumns:false,dataSourceType:"json",dataSource:[],enableUTCDates:true,height:amp.grid.setHeight("holdings-detail-grid"),width:"100%",
      rowVirtualization:true,virtualizationMode:"continuous",//virtualizationMouseWheelStep:150, //avgRowHeight: 20,
      columns: holdingsDetailGridColumns, autofitLastColumn: false,
      features: [
      {
      name:"Sorting",
      type: "remote",
      persist: true,
      columnSorting:function(evt,ui){ return amp.gridToolbar.sort("holdings-detail-grid", ui.columnKey, ui.direction);}
      }});


      • 0
        Michael Peterson
        Michael Peterson answered on Sep 16, 2016 9:37 PM

        Hello,

        Thank you for the update. The information provided leads me to believe you are missing a script reference. How are you loading the scripts? What order? Are you using the loader?

      • 0
        Jeffrey
        Jeffrey answered on Sep 19, 2016 6:00 PM

        We are loading infragistics.core.js, infragistics.dv.js, and infragistics.lob.js in same order

        I changed the order to be infragistics.loader.js, infragistics.core.js, infragistics.dv.js, and infragistics.lob.js, infragistics.document.core.js, infragistics.gridexcelexporter.js

        Is this order correct? All files required? 

        I am now getting an error Uncaught TypeError: Cannot read property 'Workbook' of undefined



      • 0
        Jeffrey
        Jeffrey answered on Sep 19, 2016 7:01 PM

        Got further with it…now new errors..

        infragistics.excel.js:88 Uncaught TypeError: $$t.$fw.getBox is not a function
        infragistics.excel.js:30 Uncaught TypeError: $$t.$cg.c is not a function

      • 0
        Michael Peterson
        Michael Peterson answered on Sep 22, 2016 2:34 PM

        Hello,

        You would also need the FileSaver.js and Blob.js as described in the following documentation and sample:

        http://www.igniteui.com/help/iggridexcelexporter-overview

        http://ko.infragistics.com/support/online-documentation

        Do you have a sample you can attach that I can look at?

      • 0
        Jeffrey
        Jeffrey answered on Nov 9, 2016 7:33 PM

        Added those files but still getting following error

        infragistics.excel.js:88 Uncaught TypeError: $$t.$fw.getBox is not a function

      • 0
        Michael Peterson
        Michael Peterson answered on Nov 10, 2016 10:06 PM

        Hello,

        Thank you for the update. Can you please provide an isolated sample that reproduces this behavior as I have been unable to reproduce the errors you are getting.

      • 0
        David Dai
        David Dai answered on Aug 24, 2018 8:28 AM

        I still have the problem

      • 0
        David Dai
        David Dai answered on Aug 24, 2018 1:18 PM

        let me provide more detail here.
        VS2015 Env

        in the _layout.cshtml (mastet template page)

        <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-2.0.0.min.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Scripts/modernizr-2.6.2.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Scripts/Infragistics/js/infragistics.core.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Scripts/Infragistics/js/infragistics.lob.js")"></script>

        <link type="text/css" rel="stylesheet" media="all" href="@Url.Content("~/Content/Infragistics/css/themes/infragistics/infragistics.theme.css")" />
        <link type="text/css" rel="stylesheet" media="all" href="@Url.Content("~/Content/Infragistics/css/structure/infragistics.css")" />

        then, in the view page aa.cshtml

        <script type="text/javascript" src="@Url.Content("~/Local/Scripts/FileSaver.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Local/Scripts/Blob.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Local/Scripts/infragistics.documents.core.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Local/Scripts/infragistics.excel.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Local/Scripts/infragistics.gridexcelexporter.js")"></script>

        then, when I click the button 'Export', call the js function 

        $("#exportButton").on("click", function () {
        var exportingOverlay = $('<div>');
        $.ig.GridExcelExporter.exportGrid($("#igGrid"), {
        fileName: excelFileName,
        gridFeatureOptions:
        {
        },
        },
        {

        exportStarting: function (e, args) {
        showOverlay(args.grid, exportingOverlay);
        },

        success: function () {
        hideOverlay(exportingOverlay);
        },

        });
        });

        it reported error message such as 

        Uncaught TypeError: $$t.$fd.a is not a function
        at Class.dispose (infragistics.excel.js:58)
        at Class._ab (infragistics.excel.js:41)
        at Class._x (infragistics.excel.js:41)
        at Class.init (infragistics.excel.js:41)
        at new Class (infragistics.core.js:319)
        at Class.styles (infragistics.excel.js:21)
        at Class._init1 (infragistics.excel.js:20)
        at Class.init (infragistics.excel.js:20)
        at new Class (infragistics.core.js:319)
        at Class._createExcelWorkbookWithWorksheet (infragistics.gridexcelexporter.js:23)

        Any suggestion?

      • 0
        Hristo Anastasov
        Hristo Anastasov answered on Aug 27, 2018 6:14 AM

        Hi David,

        According to the provided information I can only assume that the app is failing to find the necessary scripts in the corresponding ~/Local/Scripts folder, or the Ignite UI scripts in this folder might differ in version number or mix both obfuscated and non-obfuscated scripts.

        Please verify physically that the necessary files exist in the directory.

        Anyway, I am attaching a sample that uses all the necessary files for exporting in 16.1 and it seems to be working fine. You can download those scripts from the cdn (see the cdn urls in the sample) and use them in your real app to make sure exporting will work then.

        If you are still having trouble exporting, please isolate the issue in a sample that I can run on my side and investigate.

        Looking forward to hearing from you.export161.zip

      • 0
        Alan Halama
        Alan Halama answered on Aug 24, 2018 1:38 PM

        David,

        We need more details to be able to look into this.  Are you able to provide a sample like Mike P requested earlier in this thread that we can use to look into what is happening?

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Jeffrey
Favorites
0
Replies
12
Created On
Aug 27, 2018
Last Post
7 years, 6 months ago

Suggested Discussions

Tags

Created by

Created on

Aug 27, 2018 6:14 AM

Last activity on

Aug 27, 2018 6:14 AM