filamentgroup / tablesaw

A group of plugins for responsive tables.
MIT License
5.48k stars 434 forks source link

Uncaught TypeError: Cannot read property 'cloneNode' of undefined #344

Closed stevenbriscoeca closed 5 years ago

stevenbriscoeca commented 6 years ago

Hello,

https://codepen.io/stephendesjardins/pen/geBYWp?editors=1111

This is causing me to get an js error Cannot read property 'cloneNode' of undefined

I think it's caused by the colspan.

Thanks!

itandyrays commented 6 years ago

Hi. Same problem on this project demo > colspan.html choose data-tablesaw-mode="stack"

Referring to this line of code: https://github.com/filamentgroup/tablesaw/blob/master/src/tables.stack.js#L61

instr : var $header = $(this.cloneNode(true)); cause : this is undefined.

Prepend this line : if(!this || typeof(this)=="undefined")return;

and it seem be fixed but i don't know if it is necessary to continue the execution of the code for other features.