issue #23796 - csv export from gridbox

Javascript's `in` operator will search the entire prototype chain. Also you basically want to do this check anyway:
```javascript
_.isObject(obj.$)
```
That way, you also ensure that `obj.$.exportButton` doesn't needlessly fail