jQWidgets Forums

jQuery UI Widgets Forums Grid Export to Excel Question

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Export to Excel Question #13453

    DavidSimmons
    Participant

    I have been trying to use the Export to Excel function with success. I have my includes and I test the button with an alert when pressed, but nothing happens. No error no nothing… Is there any requirements other than what I have included.

    var exportExcelButton = $(“

    “);
    exportExcelButton.find(‘span’).addClass(‘ui-icon ui-icon-disk’);
    exportExcelButton.width(16);
    exportExcelButton.jqxTooltip({ content: ‘Export Excel!’, position: ‘mouse’, name: ‘Tooltip’, theme: theme });
    exportExcelButton.appendTo(tableLeft);

    exportExcelButton.click(function (event) {
    alert(“****** Export *********”);
    $(jqxgrid).jqxGrid(‘exportdata’, ‘xls’, ‘jqxGrid’);
    });

    Export to Excel Question #13456

    Peter Stoev
    Keymaster

    Hi David,

    The jQuery selection in the provided code is not correct.

    The following line: $(jqxgrid).jqxGrid(‘exportdata’, ‘xls’, ‘jqxGrid’);, should be: $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, ‘jqxGrid’); Of course, that depends on whether the Grid’s ID is set to “jqxgrid”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export to Excel Question #13458

    DavidSimmons
    Participant

    Sorry this is the way I do all my grid instance names so I can copy code around.

    var jqxgrid=”#jqxgridPCProduct”;

    exportExcelButton.click(function (event) {
    $(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, ‘jqxGrid’);
    });

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

You must be logged in to reply to this topic.