Ticket #4900 (closed defect: fixed)

Opened 13 months ago

Last modified 9 months ago

Grid does not resize with parent widgets

Reported by: BryanForbes Owned by: sorvell
Priority: high Milestone: 1.1
Component: DojoX Grid Version: 0.9
Severity: major Keywords:
Cc: alex, dylan

Description

When the grid is parented by a widget that inherits from dijit.layout._LayoutContainer, it does not resize when the parent widget resizes. Rather, you are required to use this code to get it to resize:

dojo.connect(container, "resize", grid, function() {
    grid.resize();
});

This makes using the grid as a standard widget inside container widgets a pain.

Attachments

test_grid_layout_2.html (3.7 kB) - added by BryanForbes 13 months ago.
test_grid_layout_3.html (2.6 kB) - added by guest 13 months ago.
Test case for invalid sizing of grid

Change History

  Changed 13 months ago by alex

  • owner changed from sorvell to alex
  • status changed from new to assigned

  Changed 13 months ago by alex

  • cc alex, dylan added
  • status changed from assigned to closed
  • resolution set to invalid

this bug appears to be somewhat inaccurate. See http://dojotoolkit.org/~alex/anon_view/dojox/grid/tests/test_grid_layout.html

If not parented by a ContentPane? (a known resize() event black-hole), resize events are correctly cascaded.

Marking "invalid".

  Changed 13 months ago by BryanForbes

  • status changed from closed to reopened
  • resolution deleted

Reopening and adding a test. This test is exactly like test_grid_layout.html except the bottom container is a dijit.layout.LayoutContainer?. If you move the split up, you'll notice that the bottom grid does not resize.

Changed 13 months ago by BryanForbes

  Changed 13 months ago by bill

Bryan, this looks wrong:

<div id="bottomRight" dojoType="dijit.layout.LayoutContainer" sizeMin="20" sizeShare="30">
             <div id="grid3" dojoType="dojox.Grid" model="model" structure="layout2"></div>
</div>

You can probably just get rid of the LayoutContainer? and make the Grid a child of the LayoutContainer?'s parent.

follow-up: ↓ 6   Changed 13 months ago by bill

  • status changed from reopened to closed
  • resolution set to invalid

Marking invalid; feel free to reopen with a valid testcase, as per my advice above.

in reply to: ↑ 5   Changed 13 months ago by guest

  • status changed from closed to reopened
  • resolution deleted

Replying to bill:

Marking invalid; feel free to reopen with a valid testcase, as per my advice above.

Here is a test case (test_grid_layout_3.html) that shows invalid sizing of grid when we try to set it as layoutAlign="client". Grid seems to ignore arguments passed from _LayoutWidget and takes the height from parent node (it should take parent.h-topNode.h-bottom.h).

Changed 13 months ago by guest

Test case for invalid sizing of grid

follow-up: ↓ 9   Changed 13 months ago by bill

  • owner changed from alex to sorvell
  • status changed from reopened to new
  • milestone changed from 1.0 to 1.0.1

Ah, I see the problem. resize() should accept an optional argument specfying the size. From _LayoutWidget.js:

resize: function(args){
	// summary:
	//		Explicitly set this widget's size (in pixels),
	//		and then call layout() to resize contents (and maybe adjust child widgets)
	//	
	// args: Object?
	//		{w: int, h: int, l: int, t: int}

But grid doesn't support that.

  Changed 12 months ago by peller

  • milestone changed from 1.0.1 to 1.0.2

in reply to: ↑ 7   Changed 12 months ago by guest

Are there any plans how it would be done? It would be nice if grid will fit whole available client area. Maybe there is a chance to add support for columns that will expand their width if there is more horizontal space available?

  Changed 12 months ago by peller

  • milestone changed from 1.0.2 to 1.0.3

  Changed 9 months ago by dylan

  • milestone changed from 1.0.3 to 1.1

  Changed 9 months ago by sorvell

  • status changed from new to closed
  • resolution set to fixed

(In [12794]) !strict fixes #4900. Added test in bug to grid tests. Also corrected problem with autoHeight introduced by having grid hidden in an unsized container. Fixed: grid hides in an unsized container on IE.

  Changed 9 months ago by sorvell

  • status changed from closed to reopened
  • resolution deleted

  Changed 9 months ago by sorvell

  • status changed from reopened to closed
  • resolution set to fixed

[12876] Grid should now size correctly (at least in simple layouts) inside a LayoutContainer? and a BorderContainer?

Note: See TracTickets for help on using tickets.