clarketm / TableExport

The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
https://tableexport.travismclarke.com/
Apache License 2.0
888 stars 289 forks source link

ignoreCSS Selectors Do NOT Work Dynamically without Calling table.reset() #144

Closed own3mall closed 6 years ago

own3mall commented 6 years ago

I'm using the latest version of TableExport v5 with jQuery 3.x.

When using the below ignoreCSS setting, if I dynamically add or remove the defined classes to specific <th> and <td> columns, the columns are not ignored properly unless I call table.reset() after adding or removing these classes using a toggle column control I created. I would assume that when the export function is called, it should recheck all the columns again without me having to reset anything and determine whether or not it should be ignored based on its classname.

TableExport.prototype.ignoreCSS = [".hide", ".noExcel"];
dagang007 commented 6 years ago

Hi ! Do you know where to set datetime format ? My question is just beside yours ( No.69 )

clarketm commented 6 years ago

@own3mall – the parsing process is a rather heavy, high processing-time operation since, on the client-side, it must parse arbitrarily large tables in up 4 different file formats. For this reason, the parsed output is generated one time on the execution of TableExport and does not dynamically update unless explicitly told to with a call to reset. Unfortunately, unlike React there is no diff algorithm to detect changes in TableExport.

I would be more than open to adding a robust diff algorithm to detect mutations but at the moment this is not available.

own3mall commented 6 years ago

Ok, no problem. Thanks for looking into it.