Tutorials4u.net Forum

Full Version: Does anyone have a simple example of a working DojoX Grid control ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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() } );
thanks. This works.
Reference URL's