Opened 9 years ago

Closed 9 years ago

#12091 closed defect (fixed)

appending grid to center aligned div crashes grid

Reported by: rmasse Owned by: Bryan Forbes
Priority: high Milestone: 1.6
Component: DojoX Grid Version: 1.5
Keywords: Cc: caverzan@…
Blocked By: Blocking:

Description

I've run into this problem a handful of times with 1.5

The second you try to add a DataGrid? to any center aligned container, it bombs and renders a blank screen. The second you remove the alignment, it works fine.

Sample code can be found below:

<html> <head> <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css" /> <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/Grid.css" /> <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css" />

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="parseOnLoad: true"></script>

<style type="text/css">

.dojoxGrid table { margin: 0; } html, body { width: 100%; height: 100%; margin: 0; } .claro .dojoxGridCell { font-size: 10pt; }

body {

background-color: #d5ebf6;

}

</style> </head>

<body class="claro"> <br/> <div align="center">

<div id="reportContainer" style="width:600px;height:400px;"></div>

</div> </body> <script type="text/javascript">

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

dojo.addOnLoad(function() { var store=new dojo.data.ItemFileReadStore?({

url: "/session.php?mode=getMembers&type=json"

});

var layout = [{

field: 'first_name', name: 'First Name', width: '30%'

},{

field: 'last_name', name: 'Last Name', width: '30%'

},{

field: 'member_type_id', name: 'ID', width: '25%'

},{

field: 'id', name: 'Options', width: '15%'

}];

var grid=new dojox.grid.DataGrid?({

query: { id: '*' }, id: "gridMembers", store: store, clientSort: true, noDataMessage: "<span class='dojoxGridError'>There are no members!</span>", structure: layout

}, document.createElement('div')); dojo.byId("reportContainer").appendChild(grid.domNode); grid.startup(); console.log(grid); });

</script> </html>

Change History (3)

comment:1 Changed 9 years ago by rmasse

Thought it would be usefull to add that despite the fact that the grid renders a blank screen when aligned center, when you inspect the element all looks as it should with the data present.

comment:2 Changed 9 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

comment:3 Changed 9 years ago by evan

Cc: caverzan@… added
Milestone: tbd1.6
Resolution: fixed
Status: newclosed

(In [23783]) Fixes #12091, thanks for the fix patch from Gino Andres Caverzan(IBM, CCLA), the fix works well both for LTR/RTL cases.!strict

Note: See TracTickets for help on using tickets.