3

I am upgrading the ui-grid from v3.0.0-RC.18 to v3.0.0-rc.20-76029e7 and suddenly the external-scopes attribute stops working. What is the alternative to it?

ashok_khuman
  • 599
  • 2
  • 8
  • 17

1 Answers1

12

externalScopes was removed in RC 19. You can read the notes here: https://github.com/angular-ui/ng-grid/blob/master/CHANGELOG.md#breaking-changes

Instead, you can use appScope, which has been docoumented here: http://ui-grid.info/docs/#/tutorial/305_appScope

The grid gets a property called appScope added to it that simply references its parent scope, so you don't have to pass the grid any options. If you have a function named click() on your controller's scope you can access it in your cell templates and whatnot via grid.appScope.click().

c0bra
  • 2,982
  • 23
  • 34
  • Hi, c0bra, thank your for great tutorials. But can you please explain, is it possible to access UI-Grid isolate scope from outside? This is a slight deviation from your blog post. http://stackoverflow.com/questions/35300854/how-can-i-access-ui-grid-isolate-scope-from-outside – Anton Lyhin Feb 09 '16 at 20:59
  • 1
    Sounds like an anti-pattern to me. A lot of UI-Grid's functionality is exposed through the API. I would check the docs on that or if you have a more specific question, try asking in gitter. – c0bra Feb 09 '16 at 23:08
  • Any suggestion on to access parent scope data in child scope grid in controller as syntax. Tried **grid.appScope.pVm.stat**,pVm.stat : parent controller data – Nandu Prajapati Jun 23 '17 at 14:38