[CLOSED] getRecordsValues and nested data

  1. #1

    [CLOSED] getRecordsValues and nested data

    Hi:

    If I want to pass the content of a Store to an .Net MVC action controller and take into account nested data, what is the best way to do it?

    When I say nested data, I mean the store has a model with HasMany associations, for instance, an Order and its Line Items.

    I searched the samples and I couldn't find anything concrete.

    I could use on the client side Ext.encode(someStore.getRecordsValues()) but getRecordsValues doesn't seem to copy the nested data.

    Also, is StoreDataHandler capable of deserializing nested data?

    Thank you
    Last edited by geoffrey.mcgill; Feb 26, 2013 at 7:27 AM. Reason: [CLOSED]
  2. #2
    Hi,

    'getRecordsValues' return from model fields only, if you need to add extra information then you have to do it manually (getRecordsValues returns array of objects therefore you can add any required data top each object)

    Also, is StoreDataHandler capable of deserializing nested data?
    StoreDataHandler is not designed for custom requests, it should be used for sync/load requests of Store
    You can use JSON.Deserialize method in controller action, deserialization is based on server side type which passed to Deserialize generic method therefore server side type should have corresponding properties to correct deserialization

    Why do you need to pass data from associations with base store data? Is data from asscociations changed on the client side and not available on the server side?
  3. #3
    Is data from associations changed on the client side and not available on the server side?
    Yes, that is correct. I have a scenario where the child records might be modified but not the parents. I have a 3 level hierarchy (think of Order, Line Items and for each Line Item descriptions in various languages).

    One more question, is sync sending all the child changes to the server, even when the parent didn't change but the children changed?

    Thanks
    Last edited by bogc; Feb 22, 2013 at 3:54 PM.
  4. #4
    sync request sends only dirty records and data includes fields only (fields are defined in the model)
    You can mark record as dirty by calling setDirty method of record

    Also you can save associated data separately like in the following sample
    https://examples2.ext.net/#/Associat...ple_Lazy_Load/

Similar Threads

  1. Replies: 2
    Last Post: Sep 16, 2012, 3:01 PM
  2. Replies: 1
    Last Post: Aug 29, 2012, 10:34 PM
  3. [CLOSED] Nested data in nested grids
    By FAS in forum 1.x Legacy Premium Help
    Replies: 16
    Last Post: Apr 19, 2012, 7:51 PM
  4. [CLOSED] Filtering a store with nested data
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 13, 2011, 1:27 PM
  5. Replies: 12
    Last Post: May 20, 2011, 12:35 PM

Posting Permissions