Permalink
Browse files

Fix up check for undefined table cells, add note about how Google dea…

…ls with missing rows
  • Loading branch information...
1 parent 55fdb4e commit 398b185b113911a1502413ee9bce303ba7cc8cd7 @jsoma committed Mar 17, 2013
Showing with 4 additions and 2 deletions.
  1. +3 −1 README.md
  2. +1 −1 src/tabletop.js
View
@@ -201,9 +201,11 @@ A sample lives in `/examples/timeline_setter/`
**Empty tables are trouble.** We can't get column names from them (c'mon, Google!), so don't be too confused when a table with 0 rows is coming back with an empty `.column_names` or your code starts throwing weird errors when processing the results.
+**Empty rows are trouble.** If you have a row that's completely empty, Google doesn't return any rows after the empty row. As a result, you need to make sure every line in your spreadsheet has data in it.
+
## If you are having trouble
-Turn on debugging by passing `debug: true` when you initialize Tabletop. Check out the console, I try to keep my error messages chatty and informative.
+Turn on debugging by passing `debug: true` when you initialize Tabletop. Check out the console, I try to keep my error messages chatty and informative. Or just email me at [jonathan.soma@gmail.com](mailto:jonathan.soma@gmail.com), I'm happy to help!
## Tabletop.js in the wild
View
@@ -267,7 +267,7 @@
var element = {};
for(var j = 0, jlen = this.column_names.length; j < jlen ; j++) {
var cell = source[ "gsx$" + this.column_names[j] ];
- if (cell != undefined) {
+ if (typeof(cell) !== 'undefined') {
if(options.parseNumbers && cell.$t !== '' && !isNaN(cell.$t))
element[ this.column_names[j] ] = +cell.$t;
else

0 comments on commit 398b185

Please sign in to comment.