jQWidgets Forums

jQuery UI Widgets Forums Grid Export Grid with row details

This topic contains 3 replies, has 2 voices, and was last updated by  jon74 11 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Export Grid with row details #24612

    jon74
    Participant

    Hi all,
    I am trying to understand if it is possible to export (HTML and Excel especially) my grid content, rowdetails included.

    Thanks in advance

    Jonathan

    Export Grid with row details #24619

    Peter Stoev
    Keymaster

    Hi,

    The Exporter, exports all the cell values in the Grid. Information in the Row Details is not exported. However, in case you wish to export additional data, you may pass an Array of Rows as argument to the “exportdata” method. The default Array which is being exported is the result of the Grid’s “getrows” method.

    Best Regards,
    Peter Stoev

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

    Export Grid with row details #24696

    jon74
    Participant

    Thank you for your reply Peter.

    By passing the Array of detail rows does it append to the default export or it would export only the rows contained in the array i am passing as parameter?

    In that case I should build by myself the array with both cell values in the grid PLUS the rowdetails, correct?

    Thanks again
    Jonathan

    Export Grid with row details #24730

    jon74
    Participant

    Uhm… I think I am missing something: I cannot retrieve the rowdetails data.

    Here is my snippet:

    $(“#excelExport”).click(function () {
    var rows = $(‘#jqxgrid’).jqxGrid(‘getrows’);
    var exportArray = new Array();
    for (i=0; i< rows.length; i++){
    exportArray.push(rows[i]);
    var details = $('#jqxgrid').jqxGrid('getrowdetails', i);
    if (details){
    exportArray.push(details);
    }
    }
    var exportInfo = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, null, true, exportArray);
    $(“#dataToExport”).val(exportInfo);
    $(“#dataType”).val(“excel”);
    $(“#exportDataForm”).submit();
    });

    var “exportInfo” contains the xml of Excel spreadsheet, but it has only the “getrows” value, but not the “details” ones…

    NOTE: var details is always defined as [object Object], but I don’t know how to see its properties. And I don’t have details for all rows, on the opposite I have few rows with details, which is a nested Div showing a warning label…..

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

You must be logged in to reply to this topic.