EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Franky on February 17, 2021, 12:53:57 AM



Title: [SOLVED] Datagrid export as Text file(Tab Delimited)
Post by: Franky on February 17, 2021, 12:53:57 AM
Hi Sir,

Can someone help on this? I need to export all data in the datagrid to Text file(if possible tab Delimited).

I tried to check with the "toExcel" extension, but it got error every time when we open the exported excel file, which is quite annoying & troublesome. Hence need another solution for this.

(http://excel error)


Title: Re: Datagrid export as Text file(Tab Delimited)
Post by: jarry on February 17, 2021, 07:37:33 PM
Please call the 'toCsv' method to export to a csv file. Make sure to download a newer version from https://www.jeasyui.com/extension/datagrid_export.php


Title: Re: Datagrid export as Text file(Tab Delimited)
Post by: Franky on February 17, 2021, 08:47:51 PM
Please call the 'toCsv' method to export to a csv file. Make sure to download a newer version from https://www.jeasyui.com/extension/datagrid_export.php

Hi Jarry,

Thank you for your help. After I downloaded the new version of datagrid_export.js, the download to excel button is responding, it will prompt the name & location to save the csv file, however after i confirm, it just failed with network error.

Appreciate if you can further help to check again?

My Code:

$('#btnExportCsv').bind('click', function(){
        var rows = $('#dg').datagrid('getRows');

        $('#dg').datagrid('toCsv', {
            filename: 'datagrid.csv',
            rows: rows
        });                      
});

(http://)




Title: Re: Datagrid export as Text file(Tab Delimited)
Post by: jarry on February 18, 2021, 03:33:43 AM
Please try to download again from the site.


Title: Re: Datagrid export as Text file(Tab Delimited)
Post by: Franky on February 21, 2021, 08:42:37 PM
Please try to download again from the site.

Thank You! It work as expected now. :D