-
1 Feb 2012 7:24 AM #1
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.
-
1 Feb 2012 8:11 AM #2
Hi Kveeiv,
Did you try the menu option 'Load Data" from the Store instance?
-
1 Feb 2012 10:09 AM #3
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.
-
2 Feb 2012 7:55 AM #4
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:
Any hints?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' } ] }
-
2 Feb 2012 8:00 AM #5
-
2 Feb 2012 10:15 AM #6
That does work! The store is loaded with the items. But I don't see the list in the designer or in the website...
-
2 Feb 2012 2:31 PM #7
you need a template for that. In your list, click on edit template, then map some fields to your data. Going through the getting started tutorial we have in our documentation will help you understand this step.
--
Luca Candela
twitter: @luckymethod
-
2 Feb 2012 11:39 PM #8
I already defined the template.
Unbenannt.jpg
And here is the JSON code from the store items:
Any further hints?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' } ] }
-
3 Feb 2012 12:32 AM #9
OK, I got it. I added a DataView above the List, which displayed the items correctly. Then I deleted the List and added a new one, which works. I really don't know, what was going wrong there

-
3 Feb 2012 6:21 AM #10
Not sure
If it happens again and you feel that you can reproduce a valid bug please post one in the Sencha Designer Bug Forums.Aaron Conran
@aconran
Sencha Architect Development Team


Reply With Quote