Results 1 to 6 of 6

Thread: Working with associations and parent-child relationships

  1. #1
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    321
    Answers
    9
    Vote Rating
    49
      0  

    Default Working with associations and parent-child relationships

    I am finally trying to understand how ExtJS associations work. I have not found an understandable tutorial on this issue that covers my main two use cases and especially how ExtJS differentiates between the two:

    - Association between two models through an "Id" reference.
    - Association between two models through a Parent-Child relationship.

    I have laid the ground in this fiddle, can someone tell me how to fill in the four TODOs?

  2. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    837
    Answers
    104
    Vote Rating
    169
      0  

  3. #3
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    321
    Answers
    9
    Vote Rating
    49
      0  

    Default

    Thank you, but these links do not solve my problem. I have worked through enough tutorials and got nothing working.

    But in the meantime I have found a working fiddle with associations that, when slightly renaming things, broke completely.
    So at least it helped me figure out why nothing I tried worked: it seems that the problem is not on my side.

    https://www.sencha.com/forum/showthr...n-Associations

  4. #4
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,020
    Answers
    726
    Vote Rating
    949
      0  

    Default

    But in the meantime I have found a working fiddle with associations that, when slightly renaming things, broke completely.
    Code:
    Ext.application({
        name: 'Fiddle',
    
        launch: function () {
            var form = new Ext.form.Panel({
                renderTo: document.body,
                viewModel: {
                    data: {
                        foo: new Ext.data.Model({
                            name: 'name'
                        })
                    }
                },
                items: [{
                    xtype: 'textfield',
                    bind: '{boo.name}'
                }]
            });
        }
    });
    I just did a slight rename and now the binding doesn't work. Problem isn't on my side! Put together a reasonable sized fiddle.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    321
    Answers
    9
    Vote Rating
    49
      0  

    Default

    Hello evant,

    since you're already here, could you please answer my linked question as to why changing the casing of the property broke the fiddle, instead of bringing your own "foo" vs. "boo" example? (For your info, I did use the "Search And Replace All" operation as provided by Sencha Fiddle.)

    Also, please clarify "reasonably sized fiddle". I don't think I added any bloat to my fiddle, would you mind to elaborate?

    Kind regards,

    Alexander

  6. #6
    Sencha User
    Join Date
    Apr 2013
    Posts
    837
    Answers
    104
    Vote Rating
    169
      0  

    Default

    Quote Originally Posted by alexander.urban View Post
    Thank you, but these links do not solve my problem. I have worked through enough tutorials and got nothing working.
    The first link I posted has a solution for your TODOs. Might be worth actually checking the stuff I link before assuming they are just useless tutorials which don't help you.
    https://fiddle.sencha.com/#fiddle/ovk&view/editor

Similar Threads

  1. Replies: 4
    Last Post: 22 Feb 2017, 3:00 AM
  2. Replies: 1
    Last Post: 10 Mar 2016, 12:30 PM
  3. Replies: 1
    Last Post: 29 Jun 2009, 9:20 AM
  4. Dialog Parent-Child Relationships
    By Nullity in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 16 Feb 2007, 9:43 AM

Posting Permissions

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