DGrid Resize in BorderContainer

I have a dgrid inside a BorderContainer with "liveSplitters" enabled (using Dojo 1.8). Dgrid works well, but when I move the delimiter between the left column and the leading column (which is in the dgrid), the dgrid does not resize correctly. However, if I resized the window, then the dgrid will return to the desired size (i.e., Filling 100% of the "leading" BorderContainer panel).

My dgrid is set to 100% width in CSS. Is there any way to tell dgrid to update its size after moving the splitter?

+4
source share
2 answers

Look at this example, I wrote the answer to another dgrid question: http://jsfiddle.net/phusick/VjJBT/

The CSS rule you are looking for is:

 #grid { position: absolute; top: 0; bottom: 0; left: 0; right: 0; height: auto; } 

EDIT: I thought it was a dgrid version dgrid , so I updated my dgrid version to the latest version 0.3.3 and created a test for your problem: http://jsfiddle.net/phusick/5mHTS/ .

Well, that wasn’t a version issue, but 0.3.1 and 0.3.3 works fine when resizing the BorderContainer , but only in Chrome and Firefox. I reproduced the problem in IE9 and Opera 12.10:

enter image description here

The grid must call grid.resize() to resize correctly, which does not happen in IE9 / Opera when the BorderContainer resized, but always when the window is resized.

DijitRegistry fixes the problem because layout components like BorderContainer and ContentPane call resize() on all of their dijit children when they are resized.

So, any subclass of DijitRegistry or dojo/aspect listens on resize in the parent ContentPane grid and calls grid::resize() :

 aspect.after(contentPane, "resize", function() { grid.resize(); }); 
+6
source

As noted in the comments to @phusick's answer, Dgrid resizes correctly if I use the DijitRegistry mixin. I had other problems with resizing, but they were related to the presence of the relative width of the element in my CSS (e.g. 100%). If I delete a size that was not needed by the ContentPanel, all the elements will be resized according to OK. CSS was ported from Dojo 1.5, which apparently didn’t react at all to the ContentPanel with the size set in CSS.

+2
source

All Articles