Tutorials4u.net Forum
Does anyone have a simple example of a working DojoX Grid control ? - Printable Version

+- Tutorials4u.net Forum (http://www.tutorials4u.net/forum)
+-- Forum: Discussion Forum (/forumdisplay.php?fid=1)
+--- Forum: Dojo (/forumdisplay.php?fid=8)
+--- Thread: Does anyone have a simple example of a working DojoX Grid control ? (/showthread.php?tid=72)


Does anyone have a simple example of a working DojoX Grid control ? - vijay - 02-02-2011 10:08 AM

I'm trying to add a DojoX Grid control to my website, but I can't get it to work. I'd like a simple example to start from, but there doesn't seem to be one anywhere. These are my requirements:

I need an example of the 1.2 Grid
It should load the Dojo libraries from googleapis.com (or AOL's servers; not the trunk code or the Dojo code hosted one some private server)
Other than loading the Dojo code from a public server, all the rest of the code should be contained in the HTML page. No loading data from another URL; I'm trying to get the Grid working; then I'll worry about dynamically loading data.
Amazingly, I can't find anything that meets all three requirements. Does anything know of one?


RE: Does anyone have a simple example of a working DojoX Grid control ? - tutorials4u - 02-02-2011 10:10 AM

Here you go:

Started with the standard Dojox Grid test page
Fixed CSS imports a la:

@import "http://ajax.googleapis.com/ajax/libs/dojo/1.2.3/dojox/grid/resources/Grid.css";

Loaded cross domain Dojo:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.2.3/dojo/dojo.xd.js" djConfig="isDebug:false, parseOnLoad: false">

...with parseOnLoad set to false.

Imported function that declares test_store and gave it a name:

loadStore = function(){ // some sample data

Started everything once all dojo.required classes had loaded:

dojo.addOnLoad( function(){ loadStore(); dojo.parser.parse() } );


RE: Does anyone have a simple example of a working DojoX Grid control ? - vijay - 02-02-2011 10:12 AM

thanks. This works.