Results 1 to 4 of 4

Thread: Nested fields?

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    55
    Vote Rating
    0
      0  

    Default Nested fields?

    I have a model that has nested fields. On the server-side these are associated models, but on the client-side this will be read-only, so I thought maybe just having nested fields would be easier then setting up all the models and associations.

    How would I handle nested fields in a Model? Do I need to have a custom Reader or can Sencha just handle it. Also, do templates support this?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    You can use the mapping config in the model to get a reference to a nested field.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    55
    Vote Rating
    0
      0  

    Default

    So if I use the convert() function on the field, can I just make the child field an array and put all the child elements in it? I'm not sure how this mapping should work.

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •