你要确保那 url里的xml 可以访问的了,比如官方的 // create the Data Store var store = new Ext.data.Store({ // load using HTTP url: 'sheldon.xml', // the return will be XML, so lets set up a reader reader: new Ext.data.XmlReader({ // records will have an "Item" tag record: 'Item', id: 'ASIN', totalRecords: '@total' }, [ // set up the fields mapping into the xml doc // The first needs mapping, the others are very basic {name: 'Author', mapping: 'ItemAttributes > Author'}, 'Title', 'Manufacturer', 'ProductGroup' ]) });那么,你放在tomcat里,下面这个要访问的了,就行了 http://localhost/ext-3.3.1/examples/grid/sheldon.xml ;
var store = new Ext.data.Store({
// load using HTTP
url: 'sheldon.xml', // the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'Item',
id: 'ASIN',
totalRecords: '@total'
}, [
// set up the fields mapping into the xml doc
// The first needs mapping, the others are very basic
{name: 'Author', mapping: 'ItemAttributes > Author'},
'Title', 'Manufacturer', 'ProductGroup'
])
});那么,你放在tomcat里,下面这个要访问的了,就行了
http://localhost/ext-3.3.1/examples/grid/sheldon.xml ;