Hi. I have a strange situation where I put a Grid Widget inside an AccordionPane that is initially hidden. It should be of no surprise to anyone that when the AccordionPane is selected, the Grid widget is not dispalyed properly. (On my browser, it looks like the grid widget is smashed into a as small of a space as possible)
I understnad that this is because the widget gets it's size from the AccordionPane, which is 0 when it's hidden. The problem is, I can't seem to find an appropriate place to get the grid to resize itself. It seems that the onSelected event is thrown before the window is opened, and the AccordionPane does not seem to throw any other events like onLoad.
Anyone have any idea about how I can get the Grid to redrawitself after the AccordiionPane is redrawn?
thanks!
joe

There are several methods
There are several methods discussed in the forum for this type problem. One I suggested, not necessarily desirable architecturally, is to call setTimeout("dijit.byId('grid').update()',200); when the grid container is shown, e.g., onSelected. Or maybe the resize() instead of update() or both.
It feels dirty
I thought about doing the setTimeout... but it feels a bit hackish. Is there anything else that I could possibly trigger on? Does the animaiton throw any events when it's done animating for example?
Subclass AccordionPane
I subclassed AccordionPane and added the following line to the _transition function:
_transition: function(newWidget, oldWidget) { ........ var animation = dojo.fx.combine(animations); animation.onEnd = this.childSelected; //this line added animation.play(); }, childSelected: function() {}Then override childSelected on the new accordion pane.
Hi, I have the same problem
Hi,
I have the same problem but I do not undestarde very well, the offered solutions.
Where do I have to put this code?:
setTimeout("dijit.byId('grid').update()',200);Can anybody explain me this in more detail?
Thank you!
J.
I am doing this, it gets the
I am doing this, it gets the correct width, but it does not get any height more than the header (if I put the grid outside the accordionpane it gest the correct height):
function repintaTablaHistoricos() { setTimeout("dijit.byId('grid').resize()",200); setTimeout("dijit.byId('grid').update()",200); }@import "../js/dojo/resources/dojo.css"; @import "../js/dijit/themes/tundra/tundra.css"; @import "../js/dijit/themes/tundra/tundra_rtl.css"; @import "../js/dojox/grid/_grid/tundraGrid.css"; @import "../js/dijit/themes/tundra/tundra_rtl.css"; #grid { border: 1px solid #333; width: 600px; height: 200px; } dojo.addOnLoad(function(){ // a grid view is a group of columns var view1 = { cells: [ [ {name: 'Operacion'}, {name: 'Tipo'}, {name: 'Usuario'}, {name: 'Hora Inicio'}, {name: 'Estado'}, {name: 'Detalles'} ] ] }; // a grid layout is an array of views. var layout = [ view1 ]; var grid = new dojox.Grid({ "id": "grid", "structure": layout }); dojo.byId("gridContainer").appendChild(grid.domNode); grid.render(); setRefresco(); });