sencha touch を使用して xml を解析したいのですが、 stckovrflow ですべての可能性を試しましたが、何も表示されません:
XML データ: から: http://www.aufaitmaroc.com/feeds/maroc.xml
店舗 :
Ext.define("MyApp2.store.NewsStore", {
extend: "Ext.data.Store",
requires: ["Ext.data.proxy.JsonP", "Ext.dataview.List", "MyApp2.model.News" ,"Ext.data.reader.Xml"],
config: {
model: "MyApp2.model.News",
autoLoad: true,
proxy: {
type: 'jsonp',
url: 'http://www.aufaitmaroc.com/feeds/maroc.xml',
reader: {
type: 'xml',
record: 'item',
rootProperty: 'channel'
}
}
}
});
私のモデル:
Ext.define("MyApp2.model.News", {
extend: "Ext.data.Model",
config: {
type:'tree',
fields: [
{name: 'title', type: 'auto'}
]
}
});
私の見解 :
{
xtype: "list",
store: "NewsStore",
itemTpl: '<h1>{title}</h1>'
}
Chrome のコンソールに次のエラーがあります。
私は自分の問題を解決しようとしました:これをApacheのHTTPD.confに追加します(WampServerを使用しています)
AddType application/x-font-woff .woff
AddType application/rss+xml .xml
そして私は作成しました:httpd-proxy.confを追加フォルダーに入れます
私の httpd-proxy.conf
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /EMBackend http://localhost:8383/MyApp2/index.html
ProxyPassReverse /EMBackend http://localhost:8383/MyApp2/index.html
<Location /EMBackend>
Order allow,deny
Allow from all
</Location>
これを httpd.conf に追加しました。
Include conf/extra/httpd-proxy.conf
&まだデータを表示できません。どんな助けでも大歓迎です:)
Ps:そのように JsonP を使用しようとしました:
proxy: {
type: 'jsonp',
url: 'https://ajax.googleapis.com/ajax/services/feed/load? v=1.0&q=http://www.aufaitmaroc.com/feeds/maroc.xml',
reader: {
type: 'json',
rootProperty: 'responseData.feed.entries'
}
}
ブラウザに URL を入力して試すことができるすべてのデータを取得することはできません。