-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
I'm using nested grids to create compound widgets - tight group of widgets, that can be used as opaque widgets inside other grids (moved as a unit, edited separately). As such I need a nested items to take entire space (width AND height) given by the parent gridItem, which will have user resizable heuristics.
Ideally I would have a grid.cellHeight = 'dynamic'
mean take entire height of the parent, similar to what we have today with columns taking entire width (% based sizing). Adding a new item would temporally create new rows (create scroll V bars as content won't fit) as you drag/position things around, but then size to fit as you release (shrink the cellHeight to fit, keeping same rows# and overall layout)
for now I'm trying to hack in on the side.... not working the simplest part yet!
Your environment
v 0.3.0 and latest 1.0.0-dev showing slightly different behavior (due to
Steps to reproduce
- https://jsfiddle.net/cLdzzL8p/2/
is a copy of demo/nested.html with additional code to handle item resize
$('#grid').on('gsresizestop') - pretend to resize the griditem on right (nested) or just make it wider to trigger event
- oldCellHeight = 60px should go to larger number (140px for same 300pix gridItem)
Expected behaviour
nested grid to take entire height of parent (dynamically changing)
Actual behaviour
in v0.3.0 (gridster sample) the grid DOES grow and take entire height, forcing cells to get taller as well, BUT all the siblings gridItems also grow (making me thing either it's an incorrect shared resource or the $() search is not filtered to children of nested grid.
in 1.0.0-dev (the one I use) noting seems to appears as GridStack.prototype._updateStyles() returns early due to this line of code that was moved ealier
if (this._styles._max !== 0 && maxHeight <= this._styles._max) { return; } // Keep this._styles._max increasing