O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Associating Models and loading nested data

Ext JS 4 provides a straight forward way for defining relationships between two or more Data Models. This book, for example has two authors, which can be expressed as a one-to-many relationship between a book and its authors with Model associations. The framework has support for three common relationships:

  • One-to-many (Ext.data.HasManyAssociation)
  • Many-to-one (Ext.data.BelongsToAssociation)
  • Has-one (Ext.data.association.HasOne)

This recipe will provide a basic demonstration of linking two Models together and adding associated data to the second, associated, Model from an instance of the first Model. The last part of the recipe will explore loading nested data into these associated Models.

Getting ready

This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required