Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89a120b

Browse files
committed
angular demo tweaks
* fix gridstack#2559 * changed demo to not insert new item at specific location, but appendZ * ng demo now supports 1 column mode again
1 parent ac546e5 commit 89a120b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ Possible break:
456456
we now support much richer responsive behavior with `GridStackOptions.columnOpts` including any breakpoint width:column pairs, or automatic column sizing.
457457
458458
breaking change:
459-
* `disableOneColumnMode`, `oneColumnSize` have been removed (thought we temporary convert if you have them). use `{ columnOpts: breakpoints: [{w:768, c:1}] }` for the same behavior.
459+
* `disableOneColumnMode`, `oneColumnSize` have been removed (thought we temporary convert if you have them). use `columnOpts: { breakpoints: [{w:768, c:1}] }` for the same behavior.
460460
* 1 column mode switch is no longer by default (`columnOpts` is not defined) as too many new users had issues. Instead set it explicitly (see above).
461461
* `oneColumnModeDomSort` has been removed. Planning to support per column layouts at some future times. TBD
462462

angular/projects/demo/src/app/app.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export class AppComponent implements OnInit {
3737
margin: 5,
3838
// float: true,
3939
minRow: 1,
40+
cellHeight: 70,
41+
columnOpts: { breakpoints: [{w:768, c:1}] },
4042
}
4143
private sub0: NgGridStackWidget[] = [{x:0, y:0, selector:'app-a'}, {x:1, y:0, content:'plain html'}, {x:0, y:1, selector:'app-b'} ];
4244
public gridOptionsFull: NgGridStackOptions = {
@@ -182,7 +184,7 @@ export class AppComponent implements OnInit {
182184
public addNgFor() {
183185
// new array isn't required as Angular detects changes to content with trackBy:identify()
184186
// this.items = [...this.items, { x:3, y:0, w:3, content:`item ${ids}`, id:String(ids++) }];
185-
this.items.push({x:3, y:0, w:2, content:`item ${ids}`, id:String(ids++)});
187+
this.items.push({w:2, content:`item ${ids}`, id:String(ids++)});
186188
}
187189
public deleteNgFor() {
188190
this.items.pop();

0 commit comments

Comments
 (0)