Closed deltamualpha closed 9 years ago
Ah, that's bad. I'm afraid this whole thing should be re-written, I get really terrified when I look at it now :flushed:
I think that's a fine fix for this right now, if you want to do a PR that would be :sparkles:
OK! I'll see what I can do (my main branch has diverged far enough that I can't just pull out the commit, I think).
Heck, this might be a fun project to learn me some proper JS and try a cleanup/modernization pull request...
So I actually just put in the latest version and sheetsee.js
(this project had a really old version) and it solved the issue you were having. I'm going to go ahead and push it, but there is still lots of clean up that could be done!
Ok, I spoke too soon :) I ended up breaking more things than I fixed, so let's go with your way for now!
Pull request done for that small change.
I'm seeing what you meant by the difficulty in upgrading sheetsee! I'm currently fighting with iCanHaz not having the templates available within the table() function... it's mystifying.
Update: initial work here: https://github.com/nyc-bookstores/nyc-bookstores.github.io/tree/sheetsee-upgrade. Getting strange errors when clicking on items on the map, and the popups don't render anymore. Also, I found a bug in sheetsee-table (the if-else logic on non-paginated tables is busted, causing it to render the table twice, the second time with no data, resulting in an empty table.)
So in playing around with this for my own project, I realized the table sort was broken because the function that handled that couldn't find
gData
. Some investigation (I'm no javascript pro) lead me to fix this by changing line 132 in index.html towindow.gData = gData
, 'hoisting' the variable into the global namespace. No idea if this is how you want to solve it, but I wanted to try and be a little more helpful than "it doesn't work".