0
我想开发使用dojox工具包的网格表,如所示。 我已经提到this但没有为我工作。 我想要在静态html页面中显示dojox网格表格,并显式导入所有css和js文件。 我已经为jqGrid表格做了这个,但不能为dojox网格表做。 在html页面中添加了dojo.css,claro.cssclaroGrid.css,Grid.css,dojo.js资源。如何开发dojox数据网格表
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo: dojox.grid.DataGrid View's defaultCell</title>
<link rel="stylesheet" href="./css/dojo.css">
<link rel="stylesheet" href="./css/claro.css">
<link rel="stylesheet" href="./css/claroGrid.css">
<link rel="stylesheet" href="./css/Grid.css">
<script src="./js/dojo.js" type="text/javascript"></script>
</head>
<body class="claro">
<script>
dojo.require('dojox.grid.DataGrid');
dojo.require('dojo.data.ItemFileWriteStore');
dojo.require('dijit.form.Button');
var itemList = [
{alienPop: 320000,humanPop: 56000,planet: 'Zoron'},
{alienPop: 980940,humanPop: 56052,planet: 'Gaxula'},
{alienPop: 200,humanPop: 500,planet: 'Reiutsink'},
];
dojo.addOnLoad(function() {
var itemList = [
{alienPop: 320000,humanPop: 56000,planet: 'Zoron'},
{alienPop: 980940,humanPop: 56052,planet: 'Gaxula'},
{alienPop: 200,humanPop: 500,planet: 'Reiutsink'},
];
var store = new dojo.data.ItemFileWriteStore({
data: {
identifier : 'planet',
items: itemList
}
});
grid.setStore(store);
});
</script>
<table id="myDataGrid" dojoType="dojox.grid.DataGrid" style="width:400px;">
<thead>
<tr><th field="planet" width="33%">Planet</th>
<th field="alienPop" width="33%">Aliens</th>
<th field="humanPop" width="33%">Humans</th>
</tr>
</thead>
</table>
</body>
</html>
你到目前为止尝试过什么?请发布一些你的代码并尝试改进你的问题。谢谢! – GibboK
@dkb在您的问题主体中添加代码。不在评论中。没有人会阅读它的评论 – NSNoob
@ NSNoob,谢谢,完成 请参阅本页:jsfiddle.net/bhagat_dineshbe2006/th3fuek9,它适用于IE浏览器。静态html页面不工作。 – dkb