dojox.grid - Dojo (1.9.1) datagrid does not render if not a direct child of body -
i have problems rendering datagrid in custom widget.
i able pinpoint problem this: datagrids not direct child of body do not render correctly.
showcase:
<!doctype html> <html> <head> <title>problems datagrid</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/resources/dojo.css"> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dijit/themes/claro/claro.css" media="screen"> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojox/grid/resources/grid.css"> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojox/grid/resources/clarogrid.css"> </head> <body class="claro"> <div id="outer"> </div> <div><div id="inner"> </div></div> <script> dojoconfig = { isdebug: true, async: true, has: { "dojo-firebug": true, "dojo-debug-messages": true } }; </script> <script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js" data-dojo-config="async: true"></script> <script> require([ "dojo/parser", "dojo/ready", "dojo/store/memory", "dojo/data/objectstore", "dojox/grid/datagrid" ], function(parser, ready, memory, objectstore, datagrid){ createoutergrid = function(){ var data = [{id:12,name:'outer'},{id:13,name:'blabla'}]; var datastore = new objectstore({ objectstore:new memory({ data:data }) }); var grid = new datagrid({ store:datastore, items:data, structure:[ {name:"id", field:"id", width:"20%"}, {name:"name", field:"name", width:"80%"} ] }, "outer"); grid.startup(); }; createinnergrid = function(){ var data = [{id:12,name:'inner'},{id:13,name:'blabla'}]; var datastore = new objectstore({ objectstore:new memory({ data:data }) }); var grid = new datagrid({ store:datastore, items:data, structure:[ {name:"id", field:"id", width:"20%"}, {name:"name", field:"name", width:"80%"} ] }, "inner"); grid.startup(); }; parser.parse(); ready(function(){ createoutergrid(); createinnergrid(); }); }); </script> </body> </html>
is there way make work? should log somewhere ?
i posted question here: dojo stackcontainer contains custom widget uses datagrid, dategrid not showing up didn't know caused fact datagrid should direct child of body.
grid need parent height. documented somewhere.
set height inner div parent magic.
this happen parent outter div body.
Comments
Post a Comment