Results 1 to 2 of 2

Thread: Association

  1. #1
    Sencha User Jad's Avatar
    Join Date
    Feb 2012
    Location
    annecy france / geneve suisse
    Posts
    126
    Answers
    12
    Vote Rating
    3
      0  

    Default Unanswered: Association

    Hello,

    Is it necessary to put a belongsTo association if in the auther data model the hasMany is seted

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Vote Rating
    0
      0  

    Default

    In my condition, the answer is Yes. Here is my code:
    Code:
    Ext.define('MyProject.model.MyProjectModel', {
        extend: 'Ext.data.Model',
        
        config: {
            fields: ['name', 'desc'],
            hasMany: {
                model: "MyProject.model.MyProjectDetailModel",
                name: 'detail',
                associationKey: 'detail'
            }
        }
        
    });
    Code:
    Ext.define('MyProject.model.MyProjectDetailModel', {
        extend: 'Ext.data.Model',
        
        config: {
            fields: ['logo', 'phone', 'working hours']
        }
    });

Posting Permissions

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