繁体   English   中英

Extjs XML Grid在chrome,safari,mozilla firefox中不起作用,但在IE中起作用?

[英]Extjs xml grid not working in chrome, safari, mozilla firefox but works in IE?

我正在为应用程序使用extjs,但是当我验证了xml Grid之类的一些示例时,我发现它无法在chrome和如上所述的某些其他浏览器中工作,但在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();
});

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

Firefox,Chrome和Safari可能会阻止您的JavaScript调用“ http://dev.sencha.com/deploy/dev/examples/grid/sheldon.xml”。

将XML下载到您的计算机上,并在商店声明中调整URL。

这是因为“原产地政策” 请阅读以获得更好的解释。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM