-
10 Oct 2011 12:16 AM #1
Unanswered: List in NestedList: Bug Sencha?
Unanswered: List in NestedList: Bug Sencha?
Hey,
For several days, i search to implement a list in a nestedlist, with Json file but it doesn't work.
In fact, i have my nestedList, and when i call the "getDetailCard" function, i call a list in the panel.
When i call the list like the API Documentation, it works (with data in store). But when i call a Json file by proxy in Store; it doesn't work. there is an infinite loading panel. But i checked, the Json is in good URL ...
I don't understand i did many list by this way, and they work fine.
It can be a bug?
-
10 Oct 2011 4:00 AM #2
Hi,
Have you tried a local json file?
see also: http://en.wikipedia.org/wiki/Same_origin_policy
Best regards,
Bass
-
10 Oct 2011 4:11 AM #3
hum yes,
my file is a local file, in a data folder, and i load this one by url: 'http://localhost:8888/app/data/file.json' .. Then i don't understand.
-
10 Oct 2011 4:50 AM #4
btw for local files you can use:
proxy: {
type : 'ajax',
url : 'data/file.json',
reader : {
type : 'json'
},
Can you give us a sample of your store code and json data?
-
10 Oct 2011 5:08 AM #5
Yep i tried that: url : 'data/file.json' But nothing better.
This is my Code:
The Main function with the nestedList:
Code of list:Code:getDetailCard: function(item, parent) { var itemData = item.attributes.record.data; parentData = parent.attributes.record.data; detailCard = new Ext.Panel ({ items: [WPApp.views.DirectoryItemListList] }); detailCard.update(itemData); this.backButton.setText(parentData.text); return detailCard; },
And the Json FileCode:Ext.regModel('WPApp.models.DirectoryItemListListModel', { fields: ['firstName', 'lastName'] }); WPApp.stores.DirectoryItemListListStore = new Ext.data.Store({ model : 'WPApp.models.DirectoryItemListListModel', proxy: { type: 'ajax', url: 'http://localhost:8888/WPApp/data/name.json', reader: { type: 'json', } }, autoLoad: true }); WPApp.views.DirectoryItemListList = new Ext.List({ fullscreen: true, itemTpl : '{firstName} {lastName}', store: WPApp.stores.DirectoryItemListListStore });
Like the API DOC.... I don't understandCode:[ {firstName: 'Tommy', lastName: 'Maintz'}, {firstName: 'Rob', lastName: 'Dougan'}, {firstName: 'Ed', lastName: 'Spencer'}, {firstName: 'Jamie', lastName: 'Avins'}, {firstName: 'Aaron', lastName: 'Conran'}, {firstName: 'Dave', lastName: 'Kaneda'}, {firstName: 'Michael', lastName: 'Mullany'}, {firstName: 'Abraham', lastName: 'Elias'}, {firstName: 'Jay', lastName: 'Robinson'} ]
-
10 Oct 2011 5:50 AM #6
Error in JSON
Error in JSON
I believe you need to place your attributes firstName and lastName in quotes: "firstName" and "lastName". BTW, at first, I didn't notice the error in your JSON, so I ran it through an online checker at http://json.parser.online.fr I always do that to be sure my JSON is formatted correctly.
-
10 Oct 2011 5:58 AM #7
OMG, yes thanks, i add "" like that, and i can display the list one time:
But i have another problem.Code:[ {"firstName": "Tommy", "lastName": "Maintz"}, {"firstName": "Rob", "lastName": "Dougan"}, {"firstName": "Ed", "lastName": "Spencer"}, {"firstName": "Jamie", "lastName": "Avins"}, {"firstName": "Aaron", "lastName": "Conran"}, {"firstName": "Dave", "lastName": "Kaneda"}, {"firstName": "Michael", "lastName": "Mullany"}, {"firstName": "Abraham", "lastName": "Elias"}, {"firstName": "Jay", "lastName": "Robinson"} ]
When i have my nestedList detailCard, i can display my liste now.
But when i come back with the button, i can't click another time on an item ...
Just work one time and after i can't access to ma list.
Have you an idea?
-
10 Oct 2011 6:03 AM #8
Not sure. I am new to this myself. I would check out the MVC example in this tutorial: http://www.sencha.com/learn/working-with-forms/
I was able to get the actual code from GitHub and I have been using it as a starting point https://github.com/senchalearn/Forms-demo
Hope this answers your question somehow.
-
10 Oct 2011 6:20 AM #9
hum yes i'm reading that, but i don't know if something help me.
I just have a bug with my calling view i think,
but i don't know how to answer ...
-
10 Oct 2011 8:31 AM #10


Reply With Quote