PDA

View Full Version : Help please... store is not getting Servlet data



edsarro
7 Apr 2010, 1:16 PM
Hello,

I know this topic has been covered before, but not something I can really do in my implementation. I am looking to do something relatively simple, so hopefully there's a
simple solution:

I have a servlet that is returning XML data, specifically three fields : id, url, and value.

What I need to do is populate the store I created with this data, and then use the store to spit it out for me to display on the grid. Old hat for most of you. The store is not getting populated, which I do not understand.

Source:

var rssStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: '../../Reader'
}),

reader: new Ext.data.XmlReader ({
record: 'feeds',
fields: ['id', 'url', 'value']
})
});

rssStore.load({params: {mode: 'userFeeds'}});
rssStore.on('load', addAllFeeds, this);

function addAllFeeds() {
var url = rssStore.getAt(0).get('url')); //this returns NOTHING
}

Thanks much!

edsarro
7 Apr 2010, 6:01 PM
"{\"feeds\":[{\"id\":1001,\"value\":\"ExtJS Forum\",\"url\":\"http:\\/\\/localhost:8080\\/rss_reader\\/modules\\/feed-viewer\\/testXML\\/extjsForum.xml\"}]}"

jarlau
7 Apr 2010, 10:34 PM
"{\"feeds\":[{\"id\":1001,\"value\":\"ExtJS Forum\",\"url\":\"http:\\/\\/localhost:8080\\/rss_reader\\/modules\\/feed-viewer\\/testXML\\/extjsForum.xml\"}]}"

your servlet should return XML direcly instead of JSON.

edsarro
8 Apr 2010, 4:46 AM
and no dice. I have that on load function, but it appears that I am still loading data
while I am making a call.