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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,060
    Answers
    3976
    Vote Rating
    1389
      0  

    Default

    You need to use one or the other. The only way is to add your data to the store.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    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
  •