MVC view based on heirarchical object model

I'm building an mvc view that's backed by a heirarchical object model. It's basically a grid w/ some groupings. So I've got to take the heirarchical object model and shape it into tabular data which I'll build a store from. Where does the shaping code belong? the view?

Right I've got to get the model/store to reflect the data I want in that grid (the view). That's what I said. Or did you mean something different by "map to the data I want"?

My question is: where is the appropriate place to handle transforming data from a hierarchical object model into a tabular model appropriate for display in a grid?

So let's say your service gives you back (I'll just use object literal here, admittedly not valid json) { a: "foo", b: [ "bar1", "bar2" ] } and you want that to look like [ { a: "foo", b: "bar1" }, {a: "foo", b: "bar2" } ], or some other translation, so you can use it to build a store. Where would you do that? You can't just point your store to the url that provides that original object, right? You need it to be in a row-like format.