20 Mar 2012 10:31 PM #1
Unanswered: List not getting data
I have a json store connected to a list the url is "http:\\localhost\mobile\data\appointmentList.json" and in the designer the data comes through and shown on the list.
However when I run the project in Google....no list and no errors?
21 Mar 2012 5:16 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
You need to do some debugging. First, I would add a listener to the store's load event and simply console.log out the store.getCount() and that will tell you if the store has data. If it doesn't there is a problem. If it does, which I am betting on, then you need to look at the DOM. Does the <div> for the list have a height. If not then you need to specify a height either with the height config or a layout of the list's parent container. If not then you need to go down a few levels to where the <div>s are for the rows. Are the elements you specified in your itemTpl empty? If so then it's usually that model fields aren't valid to your response data.
I'm betting that your store has data, your itemTpl and model fields are correct but your list has no height.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
25 Mar 2012 6:15 PM #3
Re: List not getting data
still not getting the concept here !!!!!
I am using the designer.....I load the store in the designer and the data loads and the attached list outputs the data as per expected.
When I view the saved application in a chrome browser I get no list of data.....why is the designer different from the browser??? Isn't the idea of the designer to prototype the design before viewing it on a browser screen??
I'm getting pretty frustrated with the whole concept here...if what I do on the designer doesn't correlate to the browser then I may as well use notepad to write my scripts!!
Followed you advice and put a listener on the store with an alert on the load....nothing...no alert on the browser.
Looking at the DOM I get no markup for the list, let alone the data.
The only difference I can see between the browser and the designer is that I manually load the store and it works.....is there something I have to do to load the store on application start in the browser? The store is registered in the application.
25 Mar 2012 6:35 PM #4
Re: List not getting data
solved the problem....needed to select autoload on the store to get it to automatically load on controll load.
Now everything is working fine.
Thanks for your help