tags:

views:

2224

answers:

2

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:

  1. I need an example of the 1.2 Grid
  2. 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)
  3. 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?

+1  A: 

Here you go:

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

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

  3. 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">

  4. ...with parseOnLoad set to false.

  5. Imported function that declares test_store and gave it a name:

    loadStore = function(){ // some sample data

  6. Started everything once all dojo.required classes had loaded:

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

And that's it: a working Dojo Grid using cross domain library demo.

Maine
A: 

thanks. This works.

Tried updating the dojo api to 1.3 and the same sample doesnt work.

Any ideas?