Results 1 to 3 of 3

Thread: Store empty after load although success callback gets a non empty records array

  1. #1
    Sencha User
    Join Date
    Jul 2014
    Posts
    10
    Answers
    1

    Default Answered: Store empty after load although success callback gets a non empty records array

    Hi,

    I have
    Code:
    File hasMany Comment
    . I have a gridview of files and underneath it a gridview of a files comment. I
    Code:
    reconfigure
    the lower gridviews store with a files
    Code:
    comments()
    store whenever a file in the upper gridview is selected. When adding a new commit, I want to reload the lower gridviews store (which already works for the files itself), to show all comments, including the new one.
    • ?? I checked that the
      Code:
      load
      call actually makes a correct ajax request with a correct response
    • ?? I added a
      Code:
      callback
      to the
      Code:
      load
      method from the store and I can see that the first argument contains all the comments that were loaded via ajax. I.E. the reader works correctly and ext was able to create a bunch of models with correct data
    • ?
      Code:
      store.count()
      returns 0
    • ? the gridview is empty after the call to load

    Whats wrong here?

  2. I found out that the model was missing the field definition for the associated_id. If this field is mandatory it should be a) added to the docs and b) extjs should throw at least a warning that the field is missing in that case.

    So anyone who runs into this from google:
    • make sure that your ext-model contains all key fields (i.e. primary key and any foreign keys) with the correct type
    • make sure you add a reader with a 'root' property defined to your proxy in case the data is wrapped in the json response


    Thanks for pointing me to the extjs fiddle.

  3. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    I think the best way to help out is to review your code with you.
    Can you post a test case either inline here or better yet at https://fiddle.sencha.com including the store (and model class if you have one defined), grid, and example data?

  4. #3
    Sencha User
    Join Date
    Jul 2014
    Posts
    10
    Answers
    1

    Default

    I found out that the model was missing the field definition for the associated_id. If this field is mandatory it should be a) added to the docs and b) extjs should throw at least a warning that the field is missing in that case.

    So anyone who runs into this from google:
    • make sure that your ext-model contains all key fields (i.e. primary key and any foreign keys) with the correct type
    • make sure you add a reader with a 'root' property defined to your proxy in case the data is wrapped in the json response


    Thanks for pointing me to the extjs fiddle.

Posting Permissions

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