olifolkerd / tabulator

Interactive Tables and Data Grids for JavaScript
http://tabulator.info
MIT License
6.76k stars 819 forks source link

table.getData() and column title #1975

Closed charloubidou closed 5 years ago

charloubidou commented 5 years ago

Hi,

I would like to save all datas in a database. For every column, i defined "editableTitle:true"

But when i want to retrieve all data using the table.getData() function, I would like to get the column titles (first line of my table) as the first object.

Is it possible to get this information? Another solution would be to use the table.getHtml(); and then extract the thead content, but I guess there is a better way to do this.

Thank you for the answer, ant thank you for this powerful tool !

aklaver commented 5 years ago

How about a CSV download?: http://tabulator.info/docs/4.2/download#csv

Example from a test table of mine: table.download("csv", "tab_test.csv");

"Id","Source","Description","Type","Unit","Year","Amount" "2551","101","Catfish-Frozen Whole Fish Dressed","Processor Inventories","1,000 Pounds","2010","768" "10821","101","Catfish-Fresh Whole Fish","Processor Inventories","1,000 Pounds","2004","120"

charloubidou commented 5 years ago

Thank you for the advice. I followed this lead and was able to reach my goals.

Have a nice day