0
votes

I think nested data loading in ExtJS 4 is impossible in real world. 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:

{
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.

1

1 Answers

0
votes

Yes you can ... sort of. One way to do it is to define separate stores for users and trainings and then use loadData(JSON.users) to load data that was prefetched.