Results 1 to 3 of 3

Thread: MVC view based on heirarchical object model

  1. #1
    Touch Premium Member
    Join Date
    Dec 2011
    Posts
    17
    Vote Rating
    0
      0  

    Default 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?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    That's up to you. Personally I'd have the Store/Model map to the data I want.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Touch Premium Member
    Join Date
    Dec 2011
    Posts
    17
    Vote Rating
    0
      0  

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •