Opened 13 years ago

Closed 12 years ago

#9453 closed defect (invalid)

Programmatical creation of DataGrid via ItemFileReadStore does not work

Reported by: martin_bo Owned by: Bryan Forbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.3.1
Keywords: dojox.grid programmatic javascript malformed Cc:
Blocked By: Blocking:


I did the following: Downloaded the tarball from Replaced the old Dojo version by the new 1.3.1 version. And suddenly the programmtical creation examples no longer worked. I tried Firefox 3.0.11 in Windows/Linux? and Chrome 2. Same result. Firefox is telling me that the Javascript files read by dojo.require are malformed, Chrome tells me: "Resource interpreted as other but transferred with MIME type application/x-javascript." XHR finished loading resource ...

The example worked just fine with the Dojo 1.2 version provided in the above example.

Here is the code for what I'm trying to do:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 TransitionalEN" ""> <html> <head>

<title>Programmatic Layout Basic</title> <style type="text/css">

@import "dijit/themes/tundra/tundra.css"; @import "dojox/grid/resources/Grid.css"; @import "dojox/grid/resources/tundraGrid.css"; @import "general.css";

</style> <script type="text/javascript" src="dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script> <script type="text/javascript">

dojo.require(""); dojo.require("dojox.grid.DataGrid?");

var jsonStore = new{ url: "json/gaskets.json" });

var grid = null;


var layout = [

{ field: "part_num", name: "Part Number", width: 'auto' }, { field: "min_temp", name: "Minimum Temperature", width: "100px" }, { field: "max_temp", name: "Maximum Temperature", width: "100px" }, { field: "type", name: "Type", width: "100px" }, { field: "thick", name: "Thickness", width: "5em" }

]; grid = new dojox.grid.DataGrid?({

query: { part_num: '*' }, store: jsonStore, structure: layout

}, 'gridNode');



</head> <body class="tundra">

<h1>Gasket Lookup</h1> <div class="partsContainer">

<div class="gridContainer">

<div id="gridNode"></div>



</body> </html>

Change History (2)

comment:1 Changed 13 years ago by martin_bo

Update: I visited the Dojo IRC channel and I think the Sitepen example is wrong there. The example misses a grid.startup() as this is mandatory for programmatic creation as I've been told!

comment:2 Changed 12 years ago by Nathan Toone

Resolution: invalid
Status: newclosed

Closing then.

Note: See TracTickets for help on using tickets.