Results 1 to 2 of 2

Thread: Using both a Store and the data config with a DataView

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    63
    Vote Rating
    6
      0  

    Default Using both a Store and the data config with a DataView

    Hi all,
    I currently have a DataView containing several DataItems that are created based on the store I pass it upon a user logging in.
    However, I'd like to try to use the data config to list all of the possible DataItems and then still pass the store to have the user's items override the default ones.

    Example:
    Code:
    ...DataView {
         data: [
              {
                   name: 'item1',
                   image: 'image-unavailable.png'
              },
              {
                   name: 'item2',
                   image: 'image-unavailable.png'
              }
         ]
    }
    Store content:
    Code:
    [
         {
              name: 'item1',
              image: 'item-available.png'
         }
    ]
    In the case above, item2 would be shown as unavailable and item1 would be shown as available (since the store would override the data config). Unfortunately, attempting to use the data config and a store throws an error. Aside from using another entire store containing all the defaults and then creating a third (temporary) store combining the user store and the defaults store, is there any way I can accomplish this task?

    Thanks!
    P.S. I can post actual code snippets if needed, but the code above should serve as a pretty good demonstration.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You need to use one or the other. The only way is to add your data to the store.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

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
  •