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
* partially fixed Rect complex example
for #2094
* fixeds part of the demo dprokop sent out, but running into a React issue I'm not familiar with...
* ultimately this is NOT the way to do things (added comment), and will concentrate on a good Angular complex demo instead... already spent 1.5d on this!
* React 2 grid demo
* fix#2094
* now works dragging between grids and staying in sync. Still not recommended way...
* Revert "Bump json5 and @angular-devkit/build-angular in /demo/angular"
This reverts commit 38f48ef.
* Complete Angular wrapper
* dynamic Angular wrapper now works - will need to create more fancy examples later.
* wrapper now handles ngFor and dynamic creation for right GridItemComponent
* NEED upcoming v7.2 release
Copy file name to clipboardExpand all lines: demo/angular/src/app/README.md
+44-9Lines changed: 44 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,41 @@
2
2
3
3
The Angular [wrapper component](./gridstack.component.ts) <gridstack> is a better way to use Gridstack, but alternative raw [NgFor](./ngFor.ts) or [Simple](./simple.ts) demos are also given.
4
4
5
-
## Usage
5
+
## Dynamic grid items
6
+
this is the recommended way if you are going to have multiple grids (alow drag&drop between) or drag from toolbar to create items, or drag to remove items...
7
+
8
+
I.E. don't use Angular templating to create children as that is harder to sync.
<gridstack-item *ngFor="let n of items; trackBy: identify" [options]="n">
38
-
Hello
72
+
Item {{n.id}}
39
73
</gridstack-item>
40
74
</gridstack>
41
75
```
@@ -45,14 +79,15 @@ You can see a fuller example at [app.component.ts](https://github.com/gridstack/
45
79
46
80
to build the demo, go to demo/angular and run `yarn` + `yarn start` and Navigate to `http://localhost:4200/`
47
81
48
-
### Caveats
82
+
## Caveats
83
+
84
+
- This wrapper needs v7.2+ to run as it needs the latest changes
85
+
- Code isn't compiled into a lib YET. You'll need to copy those files. Let me know (slack) if you are using it...
49
86
50
-
- This wrapper needs v7.1.2+ to run as it needs the latest changes
87
+
## ngFor Caveats
51
88
- This wrapper handles well ngFor loops, but if you're using a trackBy function (as I would recommend) and no element id change after an update,
52
-
you must manually update the `GridstackItemComponent.option` directly - see [modify()](./app.component.ts#L58) example.
53
-
- The original client list of items is not updated to match **content** changes made by gridstack (TBD later), but adding new item or removing (as shown in demo) will update those new items. Client could use change/added/removed events to sync that list if they wish to do so now.
54
-
- Code isn't compiled into a side lib to use right now - you need to copy those files for now. Let me know (slack) if you are using it...
89
+
you must manually update the `GridstackItemComponent.option` directly - see [modifyNgFor()](./app.component.ts#L83) example.
90
+
- The original client list of items is not updated to match **content** changes made by gridstack (TBD later), but adding new item or removing (as shown in demo) will update those new items. Client could use change/added/removed events to sync that list if they wish to do so.
91
+
55
92
56
-
thank you!
57
93
Would appreciate getting help doing the same for React and Vue (2 other popular frameworks)
0 commit comments