1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    Russia, Krasnodar
    Posts
    20
    Vote Rating
    0
    guyfawkes is on a distinguished road

      0  

    Exclamation ExtJS 4 Nested Data Loading in other way

    ExtJS 4 Nested Data Loading in other way


    I think nested data loading in ExtJS 4 is not applicable in real life. For example, I have some models for trainings, for users, and some model which describes how trainings assigned to users, which user assigned training, etc. I think it's wrong to get join in PHP Model (I use ZF 1.x) to get users first names and last names instead their identifiers, and it's wrong to merge data from two selects (select join with traings and trainings-to-users table and select from users where identifier in (list of identifiers from join above)) in Controller. Good practise to do it in View, isn't it? But ExtJS 4 nested data loading tells me: make hierarchial structure (with a lot of duplicates of nested data!) and pass it me. Why I need to do this work? I'll better merge data in Controller! My final question is: if I have JSON like this:

    Code:
    {
    trainings: [{"id":"1", "user_id":"278","assigner_id":"30", ...},{...}],
    users: ["278":{"firstname":"Guy", "lastname":"Fawkes"},"300":{....},...]
    }
    Can I to create another nested data loading from this data? Thanks.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Associations work but not really in widgets. You have to handle the getters before feeding them to widgets.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Russia, Krasnodar
    Posts
    20
    Vote Rating
    0
    guyfawkes is on a distinguished road

      0  

    Default


    Can you give me some pseudo-code? And what you mean in phrase "Associations work but not really in widgets"?

Thread Participants: 1

Tags for this Thread