Dojo和Prototype冲突?

时间:2012-04-26 19:54:24

标签: dojo prototype

我正在努力让原型和道场玩得很好,并没有取得任何成功。当我包含原型时,我得到一个涉及keydownSignal的TypeError(对象函数(对象,监听器){var keydownSignal ...})没有方法包括)。当我注释掉原型时,datagrid显示得很好。我该怎么做才能使这段代码有效?

这是html:

<!DOCTYPE html>
<html>
<head>
    <title>Dojo DataGrid and Prototype</title>
    <link rel="stylesheet" type="text/css"
      href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css" />
    <link rel="stylesheet" type="text/css"
     href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/Grid.css" />
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css" />
</head>

<body class="claro">
<div style="width: 400px; height: 200px">
    <div id="grid">
    </div>
</div>

<script type="text/javascript" src="../js/dojo/dojo.js.uncompressed.js"></script>
<!--<script type="text/javascript" src="../js/prototype.js"></script>-->
<script type="text/javascript">
dojo.require("dojo/data/ItemFileWriteStore");
dojo.require("dojox/grid/DataGrid");

dojo.declare("mydatagrid", null, {
    constructor: function(params) {
        var data = {
            items: [ {
                "number":"1",
                "name":"me"
            },
                {
                    "number":"34",
                    "name":"you"
                }
            ],
            identifier: "number"
        };

        var dataStore =
                new dojo.data.ItemFileWriteStore(
                        { data:data }
                );
        var grid = new dojox.grid.DataGrid({
            store: dataStore,
            structure: [
                {
                    "name": "name",
                    "field": "name",
                    "width": "50px"
                },
                {
                    "name": "number",
                    "field": "number",
                    "width": "100px"
                }
            ]
        }, "grid");

        grid.startup();
    }
});
var mydatagrid = new mydatagrid();
</script>

</body>
</html>

0 个答案:

没有答案