I'm a newbie at js frameworks and trying out Dojo currently to see if its best for our project. I'm struggling to get things working with Dojo. I attempted using Dojo's dgrid.The code is more or less a straight lift off from the tutorials and I believe I have all the dependecies too (like dgrid/xstyle and put-selector).Still I don't see the grid rendering on the page.Can someone please help me with this.
Here is my js setup(in tomcat)
and here is my code(almost straight lift off from the tutorial section)
<html>
<head>
<meta charset="utf-8">
<title>Tutorial: Hello dgrid!</title>
<!-- this configuration assumes that the dgrid package is located
on the filesystem as a sibling to the dojo package -->
<!-- load Dojo -->
<script>
dojoConfig ={
baseUrl: "js",
isDebug: true, // enables debug
async: true, // enables AMD loader
packages: [
{
"name": "dojo",
"location": "lib/dojo"
},
{
"name": "dgrid",
"location": "lib/dgrid"
}
]
};
</script>
<script src="dojo/dojo.js"></script>
<script>
require(["dojo/parser", "dgrid/Grid", "dojo/domReady!"], function(Grid){
alert("Hi");
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>
</head>
<body class="slate">
<div id="grid" class="slate"></div>
Hi grid
</body>
</html>
here is what i see(i don't see the grid at all and there are no js errors too).