jQWidgets Forums

jQuery UI Widgets Forums Grid MVC 4 jqxGrid

This topic contains 2 replies, has 2 voices, and was last updated by  FritzB 12 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • MVC 4 jqxGrid #21712

    FritzB
    Member

    Hi,

    Can someone please assist me? I have an MVC 4 application and have implemented the jqxGrid with some json data. I am trying to export the data in the grid to XLS but the button I have hooked up does not do anything.

    I have added the jqx-all.js and jqxcore.js and double checked the order for jquery. I have tested this functionality in an mvc 4 app but have created the javascript in the view.

    I know need to have this script code in a seperate js file. If i add an alert to the button click it fires but when i add the grid export line, nothing happens 🙁

    Please help?

    MVC 4 jqxGrid #21729

    Peter Stoev
    Keymaster

    Hi,

    If you append jqx-all.js, then jqxcore.js is not necessary because it is included in jqx-all.js. I suppose that there could be an issue related to the fact that the export functionality requires a connection to our server unless it is hosted on your server. The file that is used for Export is PHP and this could be in conflict when you have asp.net app. You can export the Grid to a local variable as a possible solution and to make this work, you should not set the “file’s name” when you call the “exportdata” method.

    Best Regards,
    Peter Stoev

    jQWidgets team
    http://www.jqwidgets.com/

    MVC 4 jqxGrid #21810

    FritzB
    Member

    Hi Peter,

    Thanks for the reply. Also thank you for the pointer about the jqxcore.js. I removed that file and gained 45ms on the app.

    I managed to sort out the issue about the export. When I export using json format with the line looking like this:

    $(“#grid”).jqxGrid(‘exportdata’, ‘json’, ‘test’);

    it works.

    When I try to export the same code but only change ‘json’ to ‘xls’ it wont work. I have found that in my code where I specify my datafields in my source that I need to specify type: ‘float’ for my hours. When I add the type the export to excel works, when I remove type it fails.

    Thanks for the help!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.