From 89a120b8e6301b4be8a5722913d8db1a8ccf1953 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Sat, 30 Mar 2024 14:15:36 -0700 Subject: [PATCH] angular demo tweaks * fix #2559 * changed demo to not insert new item at specific location, but appendZ * ng demo now supports 1 column mode again --- README.md | 2 +- angular/projects/demo/src/app/app.component.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18cb1a393..5321d7f32 100644 --- a/README.md +++ b/README.md @@ -456,7 +456,7 @@ Possible break: we now support much richer responsive behavior with `GridStackOptions.columnOpts` including any breakpoint width:column pairs, or automatic column sizing. breaking change: -* `disableOneColumnMode`, `oneColumnSize` have been removed (thought we temporary convert if you have them). use `{ columnOpts: breakpoints: [{w:768, c:1}] }` for the same behavior. +* `disableOneColumnMode`, `oneColumnSize` have been removed (thought we temporary convert if you have them). use `columnOpts: { breakpoints: [{w:768, c:1}] }` for the same behavior. * 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). * `oneColumnModeDomSort` has been removed. Planning to support per column layouts at some future times. TBD diff --git a/angular/projects/demo/src/app/app.component.ts b/angular/projects/demo/src/app/app.component.ts index 27845952c..92528ca8d 100644 --- a/angular/projects/demo/src/app/app.component.ts +++ b/angular/projects/demo/src/app/app.component.ts @@ -37,6 +37,8 @@ export class AppComponent implements OnInit { margin: 5, // float: true, minRow: 1, + cellHeight: 70, + columnOpts: { breakpoints: [{w:768, c:1}] }, } private sub0: NgGridStackWidget[] = [{x:0, y:0, selector:'app-a'}, {x:1, y:0, content:'plain html'}, {x:0, y:1, selector:'app-b'} ]; public gridOptionsFull: NgGridStackOptions = { @@ -182,7 +184,7 @@ export class AppComponent implements OnInit { public addNgFor() { // new array isn't required as Angular detects changes to content with trackBy:identify() // this.items = [...this.items, { x:3, y:0, w:3, content:`item ${ids}`, id:String(ids++) }]; - this.items.push({x:3, y:0, w:2, content:`item ${ids}`, id:String(ids++)}); + this.items.push({w:2, content:`item ${ids}`, id:String(ids++)}); } public deleteNgFor() { this.items.pop();