EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: poeziafree on February 28, 2022, 03:31:25 AM



Title: How to Modify DataGrid Export Function
Post by: poeziafree on February 28, 2022, 03:31:25 AM
Hello

Please, let me know how to Print/Download Excel file of the datagrid when serverside paging is enabled?

It only prints/downloads the current page.

Thank you in advance!


Title: Re: How to Modify DataGrid Export Function
Post by: jarry on March 01, 2022, 01:11:23 AM
Retrieve all the rows from the server site and then export to excel with the 'rows' parameter.
Code:
// export with customized rows
$('#dg').datagrid('toExcel', {
    filename: 'datagrid.xls',
    worksheet: 'Worksheet',
    caption: 'Caption',
    fields: ['itemid','productid'],
    rows: rows,
    footer: [{
        productid: 'Summary',
        listprice: 30
    },{
        productid: 'Summary',
        listprice: 40
    }]
});