You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- fix#1600
- big re-write on how `cellHeight()` works. you can now call it at any time (not just grid init options) including switching to 'auto' or other modes on the fly.
- fix `cellHeight:auto` now keeps cell square as window resizes (regressing from 2.x TS conversion). `Utils.throttle()` works better too (guaranteed to be called last event)
- new `cellHeight:initial` which makes the cell squares initially, but doesn't change as windows resizes (better performance)
- new grid option `cellHeightThrottle` (100ms) to control throttle of auto sizing triggers
- height too small with `cellHeight:auto` loading in 1 column. Now detect we load at 1 column and size accordingly (default 'auto' could make big 700x700 cells, so explicit px might still be wanted)
- added demo/cell-height.html
Copy file name to clipboardExpand all lines: doc/CHANGES.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,11 @@ Change log
49
49
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
50
50
## 3.2.0-dev
51
51
52
-
- TBD
52
+
- big re-write on how `cellHeight()` works. you can now call it at any time (not just grid init options) including switching to 'auto' or other modes on the fly.
53
+
- fix `cellHeight:auto` now keeps cell square as window resizes (regressing from 2.x TS conversion). `Utils.throttle()` works better too (guaranteed to be called last event)
54
+
- new `cellHeight:initial` which makes the cell squares initially, but doesn't change as windows resizes (better performance)
55
+
- new grid option `cellHeightThrottle` (100ms) to control throttle of auto sizing triggers
56
+
- fix [1600](https://github.com/gridstack/gridstack.js/issues/1600) height too small with `cellHeight:auto` loading in 1 column. Now detect we load at 1 column and size accordingly (default 'auto' could make big 700x700 cells, so explicit px might still be wanted)
Copy file name to clipboardExpand all lines: doc/README.md
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -70,11 +70,14 @@ gridstack.js API
70
70
See [example](http://gridstack.github.io/gridstack.js/demo/mobile.html)
71
71
-`animate` - turns animation on to smooth transitions (default: `true`)
72
72
-`auto` - if `false` gridstack will not initialize existing items (default: `true`)
73
-
-`cellHeight` - one cell height (default: `auto`). Can be:
74
-
* an integer (px)
75
-
* a string (ex: '100px', '10em', '10rem', '10%', `10vh')
76
-
* 0 or null, in which case the library will not generate styles for rows. Everything must be defined in CSS files.
77
-
*`'auto'` - height will be square cells initially.
73
+
-`cellHeight`- one cell height (default?: 'auto'). Can be:
74
+
* an integer (px)
75
+
* a string (ex: '100px', '10em', '10rem'). Note: % doesn't right - see demo/cell-height.html
76
+
* 0, in which case the library will not generate styles for rows. Everything must be defined in your own CSS files.
77
+
*`auto` - height will be calculated for square cells (width / column) and updated live as you resize the window - also see `cellHeightThrottle`
78
+
*`initial` - similar to 'auto' (start at square cells) but stay that size during window resizing.
79
+
-`cellHeightThrottle`?: number - throttle time delay (in ms) used when cellHeight='auto' to improve performance vs usability (default?: 100).
80
+
* A value of 0 will make it instant at a cost of re-creating the CSS file at ever window resize event!
78
81
-`children`?: GridStackWidget[] - list of children item to create when calling load() or addGrid()
79
82
-`column` - number of columns (default: `12`) which can change on the fly with `column(N)` as well. See [example](http://gridstackjs.com/demo/column.html)
80
83
-`class`?: string - additional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance
@@ -284,8 +287,7 @@ re-layout grid items to reclaim any empty space.
284
287
285
288
### cellHeight(val: number, update = true)
286
289
287
-
Update current cell height. This method rebuilds an internal CSS stylesheet (unless optional update=false). Note: You can expect performance issues if
288
-
call this method too often.
290
+
Update current cell height (see - `cellHeight` options format). This method rebuilds an internal CSS stylesheet (unless optional update=false). Note: You can expect performance issues if call this method too often.
0 commit comments