jQWidgets Forums

jQuery UI Widgets Forums Grid Exporting Selected Rows

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Exporting Selected Rows #58167

    Develop101
    Participant

    Hi,

    I have an issue with the code below. Can anyone see why?
    I want to export to html selected rows only, but it always returns ‘undefined’.

    var selectedrowindexes = $('#baseline').jqxGrid('selectedrowindexes');
    var gridContent;
    				
    if (selectedrowindexes.length > 1) {
        var arr = new Array();
        var pos = 0;
    
        for (idx in selectedrowindexes) {
    	rowdata = $("#baseline").jqxGrid('getrowdata', selectedrowindexes[idx]);
    	arr[pos] = rowdata;
    	pos++;
        }
    
        gridContent = $("#baseline").jqxGrid('exportdata', 'html', 'baseline', true, arr);
    }

    Many thanks

    Exporting Selected Rows #58168

    Peter Stoev
    Keymaster

    Hi TCRNottingham,

    You’re trying to export the Grid to html file called “baseline”. Your gridcontent variable will be undefined due to the reason that “exportdata” exports to a file. If you want to export to a local variable, the file name parameter should be null or not set.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Exporting Selected Rows #58169

    Develop101
    Participant

    Many thanks Peter.
    I knew it was something silly, but I have been staring at it so long, i couldn’t see it.

    Many Thanks Again
    TCRNottingham

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

You must be logged in to reply to this topic.