jspreadsheet / ce

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
https://bossanova.uk/jspreadsheet/v4
MIT License
6.7k stars 820 forks source link

reset jexcel.current in destroy method #191

Closed grumiq closed 6 years ago

grumiq commented 6 years ago

I love jExcel and it works well in my application! However, I have multiple instances on one page and deleting and creating new instances regularly produces errors; the destroy method seems not to reset the jexcel.current variable. This leads to invalid indices in references to the defaults-array. I could repair this in my case by adding

if ($.fn.jexcel.current == id) $.fn.jexcel.current = null;

in the destroy method after the source is deleted ( delete $.fn.jexcel.defaults[id]; )

pphod commented 6 years ago

It has been done. Available in the master repo. It will be released soon...

grumiq commented 6 years ago

Cool, thanks!