2010-12-07 115 views
0

我使用ExtJS的一個應用程序,但是當我驗證了一些像XML格的例子中,我發現它不使用Chrome和其他一些瀏覽器如上所述,但在IE罰款...Extjs XML網格不工作在鉻,Safari瀏覽器,Mozilla Firefox,但在IE瀏覽器?

可以請你幫我解決這個問題....這裏是萬一code..just ......

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(); 
}); 

它的HTML文件:

<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> 

回答

1

火狐,Chrome和Safari可能會阻止你的JavaScript調用'http:/ /dev.sencha.com/deploy/dev/examples/grid/sheldon.xml」。

將XML下載到您的機器並調整商店聲明中的URL。

+0

我也試過這樣做,但它並沒有幫助.... – 2010-12-13 10:38:37

相關問題