Export DataGrid

Extension » Export DataGrid

Include 'datagrid-export.js' file

Export DataGrid

Export PDF

The PDF document can be created using the pdfmake library.

Methods

The methods below extend from datagrid.

Name Parameter Description
toHtml rows Export the html table.
toArray rows Export the array data.
toExcel param Export the excel file.

Code examples:

$('#dg').datagrid('toExcel', 'datagrid.xls');
$('#dg').datagrid('toExcel', {
    filename: 'datagrid.xls',
    worksheet: 'Worksheet'
});
// export with customized rows
$('#dg').datagrid('toExcel', {
    filename: 'datagrid.xls',
    rows: rows,
    worksheet: 'Worksheet'
});
print title Print the datagrid.

Code examples:

$('#dg').datagrid('print', 'DataGrid');
// print with customized rows
$('#dg').datagrid('print', {
    title: 'DataGrid',
    rows: rows
});

Download the EasyUI Extension:

datagrid-export.zip