我最近在学习EXTJS  现在想要读取一个本地的XML文件显示到控件上我用的是html 静态页面在网上看了好多例子 自己测试就获取不到值  不知道是不是因为我是静态页面的原因 但是没理由啊 只不过访问一个本地XML文件而已官方的xml例子 本地打开也是获取不到值  然后放到了tomcat 下也不行 这个问题困扰我好几天了  帮帮忙了大哥大姐们   

解决方案 »

  1.   

    网上有很多视频。也有很多pdf文档,我最近也在学,跟着做就能成功了。
      

  2.   

    ExtJS实用开发指南这本电子书会对你有很多帮助
      

  3.   

    你要确保那 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 ;
      

  4.   

    囧 那读取不同 xml 应该怎么传啊