Skip to content

Commit 5d2a4bf

Browse files
committed
added GridStackOptions.layout for nested grid reflow
* fix #2864 * reiszing subgrid will now reflow content as requested. 'none' was changed to do nothing (so user can custimize/load/overide) a little while back.
1 parent 990456d commit 5d2a4bf

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

demo/nested.html

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ <h1>Nested grids demo</h1>
5555
minRow: 2, // don't collapse when empty
5656
acceptWidgets: true,
5757
id: 'main',
58+
resizable: { handles: 'se,e,s,sw,w'},
5859
subGridOpts: subOptions, // all sub grids will default to those
5960
children: [
6061
{x:0, y:0, content: 'regular item'},

doc/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Change log
120120
* fix: [#2859](https://github.com/gridstack/gridstack.js/pull/2859) re-enabled tests and fix numerous issues found (see CL). Also thank you [lmartorella](https://github.com/lmartorella) for getting me going and starting it.
121121
* fix: [#2851](https://github.com/gridstack/gridstack.js/pull/2851) added support for custom max layout saving - Thank you [lmartorella](https://github.com/lmartorella)
122122
* fix: [#2492](https://github.com/gridstack/gridstack.js/issues/2492) loading same layout with overlapping widget fix. v10.3.0 regression.
123+
* fix: [#2864](https://github.com/gridstack/gridstack.js/issues/2864) added `GridStackOptions.layout` for nested grid reflow during resize. default to 'list'.
123124

124125
## 11.0.1 (2024-10-21)
125126
* fix: [#2834](https://github.com/gridstack/gridstack.js/pull/2834) v11 angular missing package.json

spec/e2e/html/2576_insert_column_shift_content.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<title>Column insert bug #2578</title>
8+
<title>Column insert bug #2576</title>
99
<link rel="stylesheet" href="../../../demo/demo.css" />
1010
<script src="../../../dist/gridstack-all.js"></script>
1111
<link rel="stylesheet" href="../../../dist/gridstack-extra.css"/>

src/gridstack.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ export class GridStack {
17861786
let columnChanged = false;
17871787
if (this._autoColumn && this.parentGridNode) {
17881788
if (this.opts.column !== this.parentGridNode.w) {
1789-
this.column(this.parentGridNode.w, 'none');
1789+
this.column(this.parentGridNode.w, this.opts.layout || 'none');
17901790
columnChanged = true;
17911791
}
17921792
} else {

src/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ export interface GridStackOptions {
191191
/** additional widget class (default?: 'grid-stack-item') */
192192
itemClass?: string;
193193

194+
/** re-layout mode when we're a subgrid and we are being resized. default to 'list' */
195+
layout?: ColumnOptions;
196+
194197
/** true when widgets are only created when they scroll into view (visible) */
195198
lazyLoad?: boolean;
196199

0 commit comments

Comments
 (0)