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
<p>This example uses new v3.1 API to load the entire nested grid from JSON, and shows dragging between nested grid items (pink) vs dragging higher items (green)</p>
29
-
<p>Note: HTML5 release doesn't yet support 'dragOut:false' constrain so use JQ version if you need that (nested 2 case).</p>
30
+
<p>This example shows v5.x dragging between nested grids (dark yellow) and parent grid (bright yellow.)<br>
31
+
Uses v3.1 API to load the entire nested grid from JSON.<br>
32
+
Nested grids uses new <b>column:'auto'</b> to keep items same size during resize.</p>
Copy file name to clipboardExpand all lines: doc/CHANGES.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,7 @@ Change log
68
68
69
69
## 4.4.1-dev (TBD)
70
70
* add [#992](https://github.com/gridstack/gridstack.js/issues/992) support dragging into and out of nested grids from parents! Thank you [@arclogos132](https://github.com/arclogos132) for sponsoring it.
71
+
* add [#1910](https://github.com/gridstack/gridstack.js/pull/1910) new `column:'auto'` option to size nested grids to their parent grid item column count, keeping items the same size inside and outside. Thank you [@arclogos132](https://github.com/arclogos132) for also sponsoring it.
71
72
* fix [#1902](https://github.com/gridstack/gridstack.js/pull/1902) nested.html: dragging between sub-grids show items clipped
72
73
* fix [#1558](https://github.com/gridstack/gridstack.js/issues/1558) dragging between vertical grids causes too much growth, not follow mouse.
### `column(column: number | 'auto', layout: ColumnOptions = 'moveScale')`
369
370
370
-
set/get the number of columns in the grid. Will update existing widgets to conform to new number of columns,
371
+
set the number of columns in the grid. Will update existing widgets to conform to new number of columns,
371
372
as well as cache the original layout so you can revert back to previous positions without loss.
372
-
Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [2-11],
373
+
Requires `gridstack-extra.css`(or minimized version) for [2-11],
373
374
else you will need to generate correct CSS (see https://github.com/gridstack/gridstack.js#change-grid-columns)
374
375
375
-
-`column` - Integer > 0 (default 12), if missing it will return the current count instead.
376
+
-`column` - Integer > 0 (default 12), or 'auto' for nested grids to size themselves to the parent grid container (to make su-items the same size inside and outside)
376
377
-`layout` - specify the type of re-layout that will happen (position, size, etc...).
377
378
Note: items will never be outside of the current column boundaries. default ('moveScale'). Ignored for 1 column.
/** list of children item to create when calling load() or addGrid() */
72
72
children?: GridStackWidget[];
73
73
74
-
/** number of columns (default?: 12). Note: IF you change this, CSS also have to change. See https://github.com/gridstack/gridstack.js#change-grid-columns */
75
-
column?: number;
74
+
/** number of columns (default?: 12). Note: IF you change this, CSS also have to change. See https://github.com/gridstack/gridstack.js#change-grid-columns.
75
+
* Note: for nested grids, it is recommended to use 'auto' which will always match the container grid-item current width (in column) to keep inside and outside
76
+
* items always to same. flag is ignored for non nested grids.
77
+
*/
78
+
column?: number|'auto';
76
79
77
80
/** additional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance.
78
81
Note: only used by addGrid(), else your element should have the needed class */
0 commit comments