我是 dojo 和 dgrid 的新手。我正在关注网站上的教程,但我有两个错误
Uncaught ReferenceError: define is not defined dojo.js:1
Uncaught ReferenceError: require is not defined index.html:10
我从http://dojofoundation.org/packages/dgrid/tutorials/hello_dgrid/复制了代码,并按照所说的更改了文件夹名称。
文件在正确的位置,我找不到问题。也许我需要更改 dojo 文件中的某些内容。
<script src="dojodatagrid\dojo.js" data-dojo-config="async: true"></script>
<script>
require(["dgrid/Grid", "dojo/domReady!"],
function(Grid){
var data = [
{ first: "Bob", last: "Barker", age: 89 },
{ first: "Vanna", last: "White", age: 55 },
{ first: "Pat", last: "Sajak", age: 65 }
];
var grid = new Grid({
columns: {
first: "First Name",
last: "Last Name",
age: "Age"
}
}, "grid");
grid.renderArray(data);
});
</script>