jQWidgets Forums

jQuery UI Widgets Forums Grid Print Grid Grouping

This topic contains 3 replies, has 3 voices, and was last updated by  Dimitar 9 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Print Grid Grouping #53149

    Gopre400
    Participant

    Hi I am looking at your example of printing a grid https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm#demos/jqxgrid/printing.htm
    and I was wondering if there was a way to print the grid groupings? The grid I have has grouping on it. Thank you.

    $(“#jqxgrid”).jqxGrid(
    {
    width: ‘100%’,
    source: dataAdapter,
    theme: ‘darkblue’,
    pageable: true,
    autoheight: true,
    sortable: true,
    altrows: true,
    enabletooltips: true,
    showstatusbar: true,
    editable: true,
    groupsrenderer: groupsrenderer,
    groupable: true,
    groupsexpandedbydefault: true,
    closeablegroups: false,
    editmode: ‘click’,
    selectionmode: ‘singlecell’,
    columns: [
    { text: ”, datafield: ‘Delete’, columntype: ‘button’, width: 80, cellsrenderer: function () {
    return “Delete”;
    }, buttonclick: function (row) {
    id = $(“#jqxgrid”).jqxGrid(‘getrowdata’, row);
    var rec = $.param(id).split(“&”);
    requestid = rec[9].split(“=”);
    signid = rec[0].split(“=”);
    $(‘body’).data(‘signid’, signid[1]);
    $(‘body’).data(‘requestid’,requestid[1]);
    $(‘#popDelete’).popup(‘open’);
    }
    },
    { text: ”, datafield: ‘Complete’, columntype: ‘button’, width: 150, cellsrenderer: function () {
    return “Complete Request”;
    }, buttonclick: function (row) {
    id = $(“#jqxgrid”).jqxGrid(‘getrowdata’, row);
    var rec = $.param(id).split(“&”);
    requestid = rec[9].split(“=”);
    $(‘body’).data(‘requestid’,requestid[1]);
    GetSRQRequestSignSizeCompletedCheck(requestid[1]).success(function (data) {
    var obj = jQuery.parseJSON(data.d);
    if (obj) {
    $(‘#divFabricated’).show();
    $(‘#divNotFabricated’).hide();
    $(‘#popCompleteRequest’).popup(‘open’);
    }
    else {
    $(‘#divFabricated’).hide();
    $(‘#divNotFabricated’).show();
    $(‘#popCompleteRequest’).popup(‘open’);
    }
    });
    }
    },
    { text: ‘District’, datafield: ‘District’, width: 50, editable: false },
    { text: ‘ActivityCode’, datafield: ‘ActivityCode’, width: 100, editable: false },
    { text: ‘Quantity’, datafield: ‘SignQuantity’, width: 100, align: ‘right’, cellsalign: ‘right’ },
    { text: ‘Text’, datafield: ‘SignText’, width: 200, editable: false },
    { text: ‘Note’, datafield: ‘SignNote’, width: 200, editable: false },
    { text: ‘Size’, datafield: ‘SignSize’, width: 100, columntype: ‘combobox’,
    createeditor: function (row, cellvalue, editor) {
    var signsizesource =
    {
    datatype: “xml”,
    contentType: “application/json; charset=utf-8”,
    datafields: [
    { name: ‘SignSize’ }
    ],
    async: false,
    record: ‘Table’,
    url: “SRQWebService.asmx/GetStreetPlateSignSizeCombo”
    };
    var signsizeAdapter = new $.jqx.dataAdapter(signsizesource);

    editor.jqxComboBox({
    source: signsizeAdapter,
    displayMember: “SignSize”,
    valueMember: “SignSize”
    });
    }
    },
    { text: ‘Requested By’, datafield: ‘RequestedBy’, width: 100, editable: false },
    { text: ‘Requested Date’, datafield: ‘RequestedDate2’, width: 150, editable: false },
    { text: ‘ID’, datafield: ‘RequestID’, width: 50, editable: false, hidden: true },
    ],
    groups: [‘RequestID’]
    });
    }

    $(“#print”).click(function () {
    $(“#jqxgrid”).jqxGrid(‘beginupdate’);
    $(‘#jqxgrid’).jqxGrid(‘hidecolumn’, ‘Complete’);
    $(‘#jqxgrid’).jqxGrid(‘hidecolumn’, ‘Delete’);
    $(“#jqxgrid”).jqxGrid(‘endupdate’);
    var gridContent = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘html’);
    var newWindow = window.open(”, ”, ‘width=800, height=500’),
    document = newWindow.document.open(),
    pageContent =
    ‘<!DOCTYPE html>\n’ +
    ‘<html>\n’ +
    ‘<head>\n’ +
    ‘<meta charset=”utf-8″ />\n’ +
    ‘<title>jQWidgets Grid</title>\n’ +
    ‘</head>\n’ +
    ‘<body>\n’ + gridContent + ‘\n</body>\n</html>’;
    document.write(pageContent);
    document.close();
    newWindow.print();
    });

    Print Grid Grouping #53152

    Dimitar
    Participant

    Hello Gopre400,

    Unfortunately, groups cannot be printed – printing depends on the exportdata method and group export is not supported.

    Best Regards,
    Dimitar

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

    Print Grid Grouping #71520

    neha101288
    Participant

    Hi,

    I also need to do this , is their are any other way to this.

    Print Grid Grouping #71521

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

You must be logged in to reply to this topic.