minor code reorder
switched to a patched version of ng-grid until issue https://github.com/angular-ui/ng-grid/issues/102 is resolved