2010-12-07 33 views
0

私はextjsをアプリケーション用に使用していましたが、xmlグリッドのようないくつかの例を検証したところ、上記のようにクロムや他のブラウザでは機能しませんでした。あなたのそれのためのhtmlファイルがあるExtjs xmlグリッドはchrome、safari、mozilla firefoxでは動作しませんがIEでは動作しますか?

Ext.onReady(function(){ 

    var store = new Ext.data.Store({ 

     url: 'http://dev.sencha.com/deploy/dev/examples/grid/sheldon.xml', 
     reader: new Ext.data.XmlReader({ 
       record: 'Item', 
       id: 'ASIN', 
       totalRecords: '@total' 
      }, [ 
       {name: 'Author', mapping: 'ItemAttributes > Author'}, 
       'Title', 'Manufacturer', 'ProductGroup' 
      ]) 
    }); 

    // create the grid 
    var grid = new Ext.grid.GridPanel({ 
     store: store, 
     columns: [ 
      {header: "Author", width: 120, dataIndex: 'Author', sortable: true}, 
      {header: "Title", width: 180, dataIndex: 'Title', sortable: true}, 
      {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true}, 
      {header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true} 
     ], 
     renderTo:'example-grid', 
     width:540, 
     height:200 
    }); 

    store.load(); 
}); 

......ここケースでcode..justがある....私はこの問題を解決してください:

<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<title>XML Grid Example</title> 
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> 

    <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script> 
    <script type="text/javascript" src="../../ext-all-debug.js"></script> 
    <script type="text/javascript" src="xml-grid.js"></script> 

<link rel="stylesheet" type="text/css" href="grid-examples.css" /> 
<link rel="stylesheet" type="text/css" href="../shared/examples.css" /> 

</head> 
<body> 
<script type="text/javascript" src="../shared/examples.js"></script> 
<h1>XML Grid Example</h1> 

<div id="example-grid"></div> 

</body> 
</html> 

答えて

0

"Same origin policy"のためです。より良い説明のためにそれをお読みください。

1

Firefoxの、クロムおそらくあなたのJavaScriptが 'http://' /dev.sencha.com/deploy/dev/examples/grid/sheldon.xml 'を参照してください。

XMLをマシンにダウンロードし、ストア宣言のURLを調整します。

+0

私もそれをやってみましたが、それは助けになりませんでした.... –

関連する問題