Results 1 to 2 of 2

Thread: ExtJs6 CRUD opperation over asoociated data

  1. #1
    Sencha User
    Join Date
    Oct 2016
    Posts
    28
    Answers
    1

    Default ExtJs6 CRUD opperation over asoociated data

    I am using ExtJs6 and I'm trying to create/read/update/delete records in a grid that has association. I have a a User model that has the following definition:
    Code:
    Ext.define('MyApp.model.User', {
    extend: 'MyApp.model.Base',
    
    fields: [
        { name: 'ts_id', type: 'int' },
        { name: 'ts_name', type: 'string' },
        { name: 'ts_email', type: 'string' },
        { name: 'ts_status', type: 'int' }
    ],
    
    hasMany: [{
        model: 'MyApp.model.Address',
        name: 'addresses',
        associationKey: 'addresses'
    }]
    });
    The associated data has the following model:
    Code:
    Ext.define('MyApp.model.Address', {
    extend: 'MyApp.model.Base',
    
    fields: [
        { name: 'ts_id', type: 'int' },
        { name: 'ts_address', type: 'string' },
        { name: 'ts_user_id', reference: 'MyApp.model.User' },
    ]
    });
    I have 2 grids: one with users and one with addresses. When a record is selected from the users table, the addresses is populated with the associated data.
    I want to create/read/update/delete data from address grid. What is the best practice for doing this? Should I update the entire model (user&address) or can I update just the associated data(address)? Can it be done with a rowediting plugin?


  2. #2
    Sencha User
    Join Date
    Oct 2016
    Posts
    28
    Answers
    1

    Default

    Up

Similar Threads

  1. Extjs6 : Get Clipboard data on Keydown event of combobox
    By Praveen Kumar NC in forum Ext JS 6.x Q&A
    Replies: 3
    Last Post: 21 Jun 2016, 5:24 AM
  2. Replies: 1
    Last Post: 29 Sep 2015, 6:46 AM
  3. Replies: 3
    Last Post: 10 Aug 2015, 5:03 AM
  4. Replies: 3
    Last Post: 27 Jun 2013, 11:59 AM

Tags for this Thread

Posting Permissions

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