Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8849949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:47:11+00:00 2026-06-14T12:47:11+00:00

I’m having issues. I want to use the nice ExtJS associations, but they’re not

  • 0

I’m having issues. I want to use the nice ExtJS associations, but they’re not working properly.

Issues:

  • no association showing in the model
  • no data showing up after load

What are the quirks to watch out for?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:47:13+00:00Added an answer on June 14, 2026 at 12:47 pm

    I recently went through a very painful learning curve with the ExtJS associations, and came across some useful articles, as well as my own gotchas. Here is the summary for those who run into the same pains.

    Rules for HasMany Associations in ExtJS

    • Always put your Proxies in your Models, not your Stores, unless you
      have a very good reason not to [1]
    • Always require your child models if
      using them in hasMany relationships. [2]
    • Always use foreignKey if you want to load the children at will
    • Always use associationKey if you return the children in the same response as the parent
    • You can use both foreignKey and associationKey if you like
    • Always name your hasMany relationships
    • Always use fully qualified model names in your hasMany relationship
    • Consider giving the reader root a meaningful name (other than “data”)
    • The child model does not need a belongsTo relationship for the hasMany to work

    [1] The store will inherit its model’s proxy, and you can always override it
    [2] To make it easy, and avoid potential circular references, you can require them in app.js

    http://extjs-tutorials.blogspot.com/2012/05/extjs-hasmany-relationships-rules.html

    Rules for HasOne and BelongsTo Associations in ExtJS

    • Put the proxy in the model, unless you have a very good reason not to
    • Always use fully qualified model name
    • Always set the getterName
    • Always set the setterName
    • Always set the associationKey, if the foreign object is returned in the same response as this object
    • Always set the foreignKey, if you want to load the foreign object at will
    • Consider changing the instanceName to something shorter
    • The getter behaves differently depending on whether the foreign object is loaded
      or not. If it’s loaded, the foreign object is returned. Otherwise,
      you need to pass in a callback to get it.
    • You should set the name property if you plan to override this association.
    • You do not need a belongsTo relationship for a hasMany to work
    • Set the primaryKey property if the id field of the parent model is not “id”
    • Sometimes you need to use uses or requires for the belongsTo association. Watch
      out for circular references though.
    • Calling setter() function does
      not seem to set the instance. Set object.belongsToInstance = obj if
      calling the setter().

    http://extjs-tutorials.blogspot.com/2012/05/extjs-belongsto-association-rules.html

    Misc

    • If you’re applying your data to a grid, make sure you call reconfigure() on the grid using the new store
    • Your “foreignKey” property will be applied as a local filter to the ExtJS store; if you see the data loading over the network, but
      not showing in your grid, make sure your model has the foreignKey
      value defined as a field, or the local filter will exclude the data
      quiety. To test if this is the case, hook into the store’s “load”
      event and call store.clearFilters(), and see if your data shows up
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I want to construct a data frame in an Rcpp function, but when I
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.