Lp 1749593: Fix TypeError: Cannot set property 'grid' of undefined user/dyrcona/lp1749593-fix-set-grid-dataprovider-grid
authorJason Stephenson <jason@sigio.com>
Wed, 14 Feb 2018 23:32:46 +0000 (18:32 -0500)
committerJason Stephenson <jason@sigio.com>
Thu, 15 Feb 2018 06:58:04 +0000 (01:58 -0500)
commitf5ae1e82aa3a5e9ff927f8178ee4a8ebf51818fc
treea1134d2ff821a086bdd5435ddc0cca3f25d2131b
parentb35f0c0b92ca94a0fc151144d38ecaa40707ff70
Lp 1749593: Fix TypeError: Cannot set property 'grid' of undefined

Commit b35f0c0 added a reference to the grid in the grid.dataProvider
in services/grid.js in the web staff client.  This is great, but the
dataProvider could be undefined where it was being set.  This leads to
busted grid views and a TypeError in the console.

This commit moves the code down until after a fallback dataProvider is
used when the dataProvider is undefined and thereby avoids both
problems of adding the grid to an undefined dataProvider.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/web/js/ui/default/staff/services/grid.js