Add tutorial for retreiving data for subgrid via $http
The tutorial for subgrids has the subgrid showing data that is in the scope of the parent grid. I think a more 'real-life' scenario is to get the subgrid data using an http call.
I started looking at this and realized the subgrid shares scope with the partent grid, while I kind of thought it would have its own scopy.
Anyway, I'm looking for a pattern for showing data on a subgrid, using info retrived via http.
The sample app has the subgrid created using a template with ui-grid="row.entity.subGridOptions".
So I would assume that when the rowExpandedStateChanged event fires, I can call the $http method and stuff the returned data into row.entity.subGridOptions.data. Would that be a recommended approach?
Any examples of this anywhere?
Yes, that sounds like it should work, although I think the subgrid feature is not extensively used as yet, and could still do with some work - it has some glitches in behaviour.
This was the idea behind the subgrid, to let the user fill in the template he wants when the row expands. You can even render a detail template and not a new grid if you want
I think this something worth exploring. A demo plunker should be possible, and if it works we can put it into a tutorial.
If it is ok with everyone, I could add this into the 306_expandable_grid tutorial. I am doing the same thing on project I am working on.
PR is merged, assume this is resolved, closing.