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
grid._ignoreCB=true;// hack: ignore added/removed since we're the one doing the update
@@ -100,14 +94,15 @@ <h2>Controlled stack</h2>
100
94
101
95
return(
102
96
// ********************
103
-
// NOTE: constructing DOM grid items in template when gridstack is also allowed editing (dragging between grids, or adding/removing from say a toolbar)
97
+
// NOTE: constructing DOM grid items in template when gridstack is also allowed creating (dragging between grids, or adding/removing from say a toolbar)
104
98
// is NOT A GOOD IDEA as you end up fighting between gridstack users' edits and your template items structure which are not in sync.
105
99
// At best, you end up re-creating widgets DOM (from React template) and all their content & state after a widget was inserted/re-parented by the user.
106
100
// a MUCH better way is to let GS create React components using it's API/user interactions, with only initial load() of a stored layout.
107
-
// see the upcoming Angular component wrapper that does that instead (lib author uses Angular). TBD creating React equivalent...
101
+
// See the Angular component wrapper that does that: https://github.com/gridstack/gridstack.js/tree/master/demo/angular/src/app (lib author uses Angular)
102
+
// ...TBD creating React equivalent...
108
103
//
109
-
// Also templating forces you to spell out the 12+ attributes GS supports (only x,w,w,h done below) instead of passing a option structure that supports everything
110
-
// is not robust as things get added, and pollutes the DOM attr for default/missing entries, vs optimized code in GS.
104
+
// Also templating forces you to spell out the 15+ GridStackWidget attributes (only x,y,w,h done below), instead of passing an option structure that
105
+
// supports everything, is not robust as things get added and pollutes the DOM attr for default/missing entries, vs the optimized code in GS.
0 commit comments