Hybrid View

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    92
    Vote Rating
    3
    kveeiv is on a distinguished road

      0  

    Default Loading "sample" data in to stores for prototyping

    Loading "sample" data in to stores for prototyping


    I think this is my own failing to figure out the proper conventions, so I am opening this up in the help forum instead of the bugs.

    I would like to see List (or I guess probably DataView) type components show their data while in design view.

    To attempt to do this I have:
    * Added a model ("Account")
    * Added a store ("Accounts") with config options of model "Account" and data as an array of json data matching the model definition
    * Added a memory proxy to "Accounts" with default config
    * Added a json reader to memory proxy with idProperty set properly
    * Created a List using the Accounts store

    When running this from within the browser, the store data is properly loaded which the List reflects, and through the console I can verify that the records in Ext.getStore('Accounts') are all populated correctly (the expected values in .data and the various id member variables).

    When viewing this in the designer, the only thing that shows is emptyText, if it is set - and regardless of whether deferEmptyText is set.

    Do I have something wrong in my configuration? Am I trying to do the impossible? Should this be possible and moved over to Bugs? Any guidance is appreciated.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    Hi Kveeiv,
    Did you try the menu option 'Load Data" from the Store instance?

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    92
    Vote Rating
    3
    kveeiv is on a distinguished road

      0  

    Default


    Quote Originally Posted by bharatn View Post
    Hi Kveeiv,
    Did you try the menu option 'Load Data" from the Store instance?
    Awesome, I figured that would have to be somewhere already since it seems like a basic use case. Thanks! That was easy once I knew what to do.

    I hadn't looked through the context menus on all the different project items, there are a lot of good things in those but from a beginning designer user's perspective they do not jump out as available.

    Maybe some tool icons or something could be presented inline with the collapsible "what class is this" block for alternative access to those context options. For the store load at least specifically, there is an "eye" tool icon that shows up next to the store after loading the data, which shows the response. A state might be added to this tool that initiates the load data process, which I can imagine saving lots of time when needing to often load the store data. Similarly, there is probably some usefulness to being able to clear the store data as well.

    Just some general low priority feedback! Thanks for the quick response, it feels much better to be prototyping while seeing real list data.

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    330
    Vote Rating
    1
    PranKe01 is on a distinguished road

      0  

    Default


    Hi guys,

    I tried to load data from local disk to the list. The store works fine - I see that all 6 items are loaded. But the list in the designer and in the html-page is empty The store is linked to the list... The itemTpl looks like this:

    <div>{item}</div>

    And the JSON looks like this:

    Code:
    {    
    success: true,
        
    total: 6,
        
    items: [
            
    {
                id: 1,
                item: 'item1'
            },
            
    {
                id: 2,
                item: 'item2'
            },
            
    {
                id: 3,
                item: 'item3'
            },
            
    {
                id: 4,
                item: 'item4'
            },
            
    {
                id: 5,
                item: 'item5'
            },
            
    {
                id: 6,
                item: 'item6'
            }
        ]
    }
    Any hints?

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    right click store and load data.

  6. #6
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    330
    Vote Rating
    1
    PranKe01 is on a distinguished road

      0  

    Default


    That does work! The store is loaded with the items. But I don't see the list in the designer or in the website...