Results 1 to 3 of 3

Thread: Should a parent row in a HasMany relationship marked as dirty if its children change?

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2010
    Vancouver, Canada
    Vote Rating

    Default Should a parent row in a HasMany relationship marked as dirty if its children change?

    Currently, it seems that if I have master-detail relationship, for instance, an Order has many LineItems, if the line items are changed (i.e. deleted, added, modified) the Order row is not marked as dirty automatically.

    Shouldn't it?

    In my example, if I provide the UI to edit an Order (whose data is represented as a model with relationships), when the user clicks the Save button I want all the changes in the store (including changes in the children) to be sent to the server so I can persist these changes in the database. However, orderStore.getModifiedRecords() returns [] even though the children have been modified.

    If I were to keep track of Order and Line Items using separate stores (ExtJs 3.x way) this would work because I can send the changes to the orderStore and the lineItemsStore together.


  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    The reason it's not is the association is just to split out data. There is not event bubbling from child associated data to the main data.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2007
    Vote Rating


    I just started working with associations and ran into this scenario. I personally think that ideally it should mark the parent as dirty too.

Posting Permissions

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