PDA

View Full Version : load XMLStore with phonegap



stefx
9 Feb 2011, 5:30 AM
Hi to all, I've used this store to load data from XML:



var store = new Ext.data.Store({
autoLoad: true,
proxy: {
type: 'ajax',
url: 'http://<path>/file.xml',
reader: {
type: 'xml',
record: 'record'
}
},
fields: ['id','nome','descrizione']
});


I need to put this code inside phonegap application but I can't use an ajax proxy because I don't know the exact url.

Wich kind of proxy I can use? Otherwise, I to use loadData method with an XML file?

Thanks a lot
Stefano

stefx
9 Feb 2011, 12:00 PM
Anyone???
thanks

azfrederick
11 May 2011, 11:22 AM
Can you just create the proxy at runtime and pass in the URL?



var urlPath = 'http://mypath.com/file.xml'
var store = new Ext.data.Store({
autoLoad: true,
proxy: {
type: 'ajax',
url: urlPath,
reader: {
type: 'xml',
record: 'record'
}
},
fields: ['id','nome','descrizione']
});