PDA

View Full Version : Best pratice to build a master-detail with grid and form



wesleyk
13 Feb 2014, 9:01 AM
I did quite some development with extjs 3.
I'm now switching to extjs4 using architect.
I'm wondering what is the best practice to make a master-detail with a grid and a form.
Let's say we have a grid with orders and the lines only contain general information about the orders (number,total,shipping method)
Then I want to select an order and open a form via a button with all detailed information (delivery address, invoice address, products, payment method,etcetc)
In extjs 3 I used to make a grid with a store/json/ajax requesting a list from server.
With a button click I opened a form with the id of the selected row and then load the form via json.
I'm now wondering how to do this maybe better in 4? With models/associations between models?
I have been struggling to find a good example. Usually they are just binding the form and grid and only have the same information the grid store as in the form.
Hope my question is clear:-)

scottmartin
13 Feb 2014, 9:15 AM
It is true we need to create a few examples for this, but perhaps this UX may help:
https://github.com/mitchellsimoens/Ux.grid.plugin.AssociationRowExpander

It shows how to have nested grids with examples of using associated data.

As for best practice, that is based on the requirement. I have used both.

Associated is quicker and less traffic on navigation (more at initial load)
Ajax call on each has traffic and slower, but data is more recent as it is loaded each time.