fix web2py.js with show_if and grid

Given this example (with or without rows)
```python
    db.define_table('stuff',
        Field('approved', 'boolean'),
        Field('approved_on', 'datetime')
    )
    db.stuff.approved_on.show_if = (db.stuff.approved == True)
    grid = SQLFORM.grid(db.stuff, user_signature=False)
    return dict(grid=grid)
```
web2py.js fails raising a javascript exception