[Dojo-interest] data, column titles not displaying in Grid

John.C.Cartwright at noaa.gov John.C.Cartwright at noaa.gov
Thu Apr 9 16:16:30 EDT 2009


Hello All,

I'm having trouble w/ a Grid where the data and titles are not
displaying.  I get the same number of empty rows as items in my
DataStore, but no title nor data.

I can't see what I'm doing wrong - can someone please correct me?

Thanks!

--john



<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title>Test Page</title>
		<link rel="stylesheet" type="text/css"
href="../js/dijit/themes/tundra/tundra.css" />
		<link rel="stylesheet" type="text/css"
href="../js/dojox/grid/resources/Grid.css" />
		<link rel="stylesheet" type="text/css"
href="../js/dojox/grid/resources/tundraGrid.css" />
		<style>
         body, html {
            margin:0; 
            padding:0; 
            height:100%;
            width:100%; 
         }      
		</style>

		<script djConfig="parseOnLoad:true,isDebug:true"
				type="text/javascript"
				src="../js/dojo/dojo.js">
		</script>
   
		<script type="text/javascript">
			dojo.require("dojo.parser");
			dojo.require("dojo.data.ItemFileReadStore");
			dojo.require("dojox.grid.DataGrid");

			var itemCount = 0;
			dojo.addOnLoad(function() {
				grid.store.comparatorMap = {};
				grid.store.comparatorMap['name'] = function(a,b) { return
(a.localeCompare(b)); };
                     
				featureStore.fetch({
					onItem: function(item) {
						itemCount = itemCount+1;
						console.log("name: "+grid.store.getValue(item,'name'));
					},

					onComplete: function(items,request) {
						console.debug("Complete: "+itemCount+" items");
					}
				});
			});
		</script>
	</head>
	
	<body class="tundra">
		<div dojoType="dojo.data.ItemFileReadStore"
			jsId="featureStore"
			url="../searchResults.json" >
		</div>

		<div align="center">
			<h2>Query Results</h2>
			<div id="featureList"  style="width: 450px; height: 400px;">
				<table align="center" id="gridNode" jsId="grid"
dojoType="dojox.grid.DataGrid" store="featureStore">
					<thead>
						<tr>
							<th field="id" width="auto">ID</th>
							<th field="name" width="100px">Name</th>
							<th field="type" width="100px">Type</th>
						</tr>
					</thead>
				</table>
			</div>
		</div>
</body>
</html>


More information about the Dojo-interest mailing list