Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

[11:09:13 CST(-0600)] <TonyUnicon> Hey Dan are you at the keyboard?

[11:09:40 CST(-0600)] <dmccallum54> yes

[11:10:06 CST(-0600)] <TonyUnicon> I'm sort of struggling with something, I'm hoping you can help

[11:10:10 CST(-0600)] <dmccallum54> ok

[11:10:21 CST(-0600)] <TonyUnicon> I'm trying to represent a one to many relationship in the ExtJs model

[11:10:37 CST(-0600)] <TonyUnicon> using hasMany: ect..

[11:10:54 CST(-0600)] <TonyUnicon> it looks like that is not used anywhere else in the app

[11:11:11 CST(-0600)] <TonyUnicon> and its not clear to me where else we serialize a one-to-many relationship to JSON

[11:11:47 CST(-0600)] <dmccallum54> um. let me see if i can track down an example. dont have an env up at the moment. give me a few.

[11:11:54 CST(-0600)] <TonyUnicon> ok

[11:25:59 CST(-0600)] <dmccallum54> so

[11:26:16 CST(-0600)] <dmccallum54> i'm not finding first-class hasMany relationships in client-side extjs models

[11:26:36 CST(-0600)] <dmccallum54> looking at how this is handled when there's a server-side hasMany relationship tho...

[11:26:50 CST(-0600)] <dmccallum54> for example: Challenge -> ChallengeCategory

[11:27:19 CST(-0600)] <dmccallum54> it looks like the client side Challenge model doesn't know anything about ChallengeCategories (but the server-side model does)

[11:27:44 CST(-0600)] <dmccallum54> and what ends up happening is the UI pulls both model lists as completely independent models

[11:29:00 CST(-0600)] <dmccallum54> in this particular case the UI actually represents more of the reverse relationship (categories having challenges) but the main point is that it relies on an API call to describe the relationship

[11:29:44 CST(-0600)]

<dmccallum54> i.e. you expand a category and there's an API call to /reference/categeory/

Unknown macro: {category-id}

/challenge, which returns a list of challenge models

[11:35:58 CST(-0600)] <TonyUnicon> ok, yeah that was the worst case scenario another API call

[11:36:03 CST(-0600)] <TonyUnicon> seems overkill

[11:36:16 CST(-0600)] <TonyUnicon> thanks for your help

  • No labels