Tabulator: Features for improved download module

Created on 23 Sep 2018  路  11Comments  路  Source: olifolkerd/tabulator

Hey All,

I have had a few people looking for additional functionality for file downloads, including:

  • 鉁旓笍 allowing download of hidden columns
  • choosing if filtered rows are in the download
  • 鉁旓笍 showing grouped rows in the download
  • 鉁旓笍 showing column group headers in the download
  • 鉁旓笍 include column calculations in downloads

Rather than having lots of issues relating to this, i thought i would create one issue where people can share their thoughts so i can put it on the roadmap for the next version.

Cheers

Oli :)

Enhancement Question - Ask On Stack Overflow

Most helpful comment

Version 4.1 was released today and now allow grouped columns and grouped rows to be included in the download (depending on the downloader type)

A new downloadConfig option allows you to configure what elements are included in the download, more options will be added to this list in later versions:

var table = new Tabulator("#example-table", {
    downloadConfig:{
        columnGroups:false, //include column groups in column headers for download
        rowGroups:false, //do not include row groups in download
    },
});

Cheers

Oli :)

All 11 comments

I definetly would appreciate this feature. I have a massive table and only a small fraction is shown but the complete table should be downloaded.
Thanks for this great framework

I'm trying to figure out a simple way to make downloads where the value is null render as empty rather than rendering as the string "null". I suspect there's probably already a way to do this but I haven't quite found it yet.

Hey @tentus

You can use a download accessor for this:

//define custom accessor
var nullToEmptyString = function(value, data, type, params, column){
    //value - original value of the cell
    //data - the data for the row
    //type - the type of access occurring  (data|download|clipboard)
    //params - the accessorParams object passed from the column definition
    //column - column component for the column this accessor is bound to

    return value || ""; //return the new value for the cell data.
}

//column definition
{title:"Name", field:"name", accessorDownload:nullToEmptyString}

I hope that helps,

Cheers

Oli :)

Version 4.1 was released today and now allow grouped columns and grouped rows to be included in the download (depending on the downloader type)

A new downloadConfig option allows you to configure what elements are included in the download, more options will be added to this list in later versions:

var table = new Tabulator("#example-table", {
    downloadConfig:{
        columnGroups:false, //include column groups in column headers for download
        rowGroups:false, //do not include row groups in download
    },
});

Cheers

Oli :)

Hey @olifolkerd
Any status on the option to download hidden columns? Would love to see this feature!
Are you planning on releasing it in 4.2?

@Rodbjartson Yes i will look at adding that in 4.2 :)

Happy days!

Hey, @olifolkerd

Are there any plans for adding the column calculations to the xlsx or pdf exports?

when version 4.2 is released on monday you will be able to include hidden columns in the download by setting the download property to true in the column definition:

 {title:"id", field:"id", visible:false, download:true}

Column calculations will also be included in downloads by default

Cheers

Oli :)

Not being able to download the full table - I use remote paging with many pages - is a bit frustrating. However, it could be somehow done by setting pagination to "max" before/while downloading.

Getting a sample of how to do it would be good enough ...

Hey, @olifolkerd. I麓m recently using the library, and it麓s great.

I there a way to format a column total when exporting the table?

this is the code for the column definition:

{title:"Sales", field:"sales", width:150 , align:"right" ,
bottomCalc :"sum",bottomCalcFormatter:"money" ,
bottomCalcFormatterParams:{
decimal:"," , thousand:"." , symbol:"$ " , symbolAfter:false , precision:false,
},
formatter:"money", formatterParams:{
decimal:"," , thousand:"." , symbol:"$ " , symbolAfter:false , precision:false,
},
sorter:"number",
accessorParams:{}, accessor:caSales,
},

  var caSales= function(value, data, type, params, column){
    return numeral(value).format('$ 0,0'); 
  }

The column data is exported with the correct format, but column total is exported without format.

try both export to PDF and XLSX.

Thanks in advance,

Luis

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KES777 picture KES777  路  3Comments

andreivanea picture andreivanea  路  3Comments

iBek23 picture iBek23  路  3Comments

sphynx79 picture sphynx79  路  3Comments

yaxino picture yaxino  路  3Comments