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

k.louveaux at alinto.com k.louveaux at alinto.com
Fri Apr 10 04:03:26 EDT 2009


You can try "margin:0 auto;" on the grid

Kenny

-----Message d'origine-----
De : dojo-interest-bounces at mail.dojotoolkit.org
[mailto:dojo-interest-bounces at mail.dojotoolkit.org] De la part de John
Cartwright
Envoyé : vendredi 10 avril 2009 1:36
À : dojo-interest at mail.dojotoolkit.org
Objet : Re: [Dojo-interest] data, column titles not displaying in Grid

Finally found that 'align="center"' in the div containing the grid was 
preventing the data display.  So, can someone suggest a better method 
for center a grid on the page?

Thanks!

--john


John.C.Cartwright at noaa.gov wrote:
> 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>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>   
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest at mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



More information about the Dojo-interest mailing list