I have the following problem:
By programmatically creating dijit.Dialog and dojox.grid.DataGrid (associated with the global data storage of variables (dojo.store.Memory)), the contents of the Dialog are not displayed while the size of the dialog remains at a minimum.
The DataGrids store is full and Firebug displays the grid inside the dialog box.
data = new dojo.data.ObjectStore( { objectStore: new dojo.store.Memory({data:[]}) }); data.put({id:0,name:'Franklin'}); showDialog = function(){ var dlg = dijit.byId('myDlg'); if(dlg){ dlg.show(); } else{ var cp = new dijit.layout.ContentPane({style:"width:500;height:500;"}); var grid = new dojox.grid.DataGrid({ store : data, structure : [ {field:'id',name:'ID',width:'50px'}, {field:'name',name:'Name',width:'400px'}] },cp); dlg = new dijit.Dialog({ id:'myDlg', title:'Names', content:cp.domNode }); grid.startup(); dlg.show(); } );
Maybe I added something in the wrong order?
Also I don't know, the way I combine / add dojo widgets using the domNode property is the right way to do things.
I do not know if ContentPane is needed to place the Grid inside the dialog box. Both options have not worked so far.
Finally, I'm not sure what and where the Dialog needs static measurements for the right size. In my experience, the dialog itself does not need a static width or height, but so far I have no experience adding a dynamic component as a grid - which can change its size later on when launching - in the dialog box.
source share