EasyUI Forum
April 30, 2024, 11:13:26 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] Datagrid export as Text file(Tab Delimited)  (Read 3858 times)
Franky
Newbie
*
Posts: 14


View Profile Email
« 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.

« Last Edit: February 21, 2021, 08:43:40 PM by Franky » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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
Logged
Franky
Newbie
*
Posts: 14


View Profile Email
« Reply #2 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
        });                      
});




« Last Edit: February 18, 2021, 12:06:39 AM by Franky » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: February 18, 2021, 03:33:43 AM »

Please try to download again from the site.
Logged
Franky
Newbie
*
Posts: 14


View Profile Email
« Reply #4 on: February 21, 2021, 08:42:37 PM »

Please try to download again from the site.

Thank You! It work as expected now. Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!