Hi Friends. I was working on a simple data grid using Dojo. Thanks to SitePen’s blogs. It was quite useful except on behalf of the fact that i messed up with the css as well as took some time to manufacture over.
Dojo makes an intensive utilize of JSON as well as it’s really a brilliant idea which is evolving quite firmly. We are there to utilize JSON more in the future.
Try to deploy in any web server as well as manufacture sure the Dojo, Digit as well as Dojox are in the path of this file which we deploy.
<html><head>
<script type=”text/javascript” src=”dojo/dojo.js” djconfig=”parseOnLoad: true, isDebug: false”> </script>
<script type=”text/javascript” src=”dojox/grid/Grid.js”></script>
<style type=”text/css”>
@import “dojox/grid/_grid/tundraGrid.css”;
</style>
<script type=”text/javascript”>
var data = [
[ '4001', 'SB', '19/10/1983', '19/10/1920' ],
[ '4002', 'SB', '20/10/1983', '20/10/1920' ],
[ '4003', 'FD', '21/10/1983', '21/10/1920' ],
[ '4004', 'FD', '22/10/1983', '22/10/1920' ]
];
var cell = { name: ‘Cell Name’ };
var subrow = [ cell ];
var view = { rows: subrow };
var structure = [ view ];
var subrow = [
{ name: 'Account Number' },
{ name: 'Account Type' },
{ name: 'Start Date' },
{ name: 'Expiry Date' }
];
var view = {
rows: [ subrow ]
};
var structure = [
view
];
var model = new dojox.grid.data.Table(null, data);
</script>
</head><body>
<div>
</body></html>
PS:- Try the latest Dojo version to avoid any mishaps.
One problem regarding working on DOJO is the lack of documentation as well as heavy depencendy on search engines. This has been felt/discussed in numerous places. When i had to find the list of dijit widgets i could not get proper answers. Finally found this link: http://redesign.dojotoolkit.org/jsdoc/dijit/HEAD/dijit.form.
And do write in your feedback when you endeavour to populate grid using JSON or any other technique.
|