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
-[gridstack.js for specific frameworks](#gridstackjs-for-specific-frameworks)
41
+
-[Migrating](#migrating)
42
+
-[Migrating to v0.6](#migrating-to-v06)
43
+
-[Migrating to v1](#migrating-to-v1)
44
+
-[Migrating to v2](#migrating-to-v2)
44
45
-[jQuery Application](#jquery-application)
45
46
-[Changes](#changes)
46
47
-[The Team](#the-team)
@@ -69,7 +70,7 @@ npm install --save gridstack
69
70
ES6 or Typescript
70
71
71
72
```js
72
-
import{ GridStack }from'gridstack';
73
+
importGridStackfrom'gridstack';
73
74
import'gridstack/dist/gridstack.min.css';
74
75
```
75
76
@@ -150,17 +151,6 @@ let grid = GridStack.init();
150
151
grid.printCount();
151
152
```
152
153
153
-
## gridstack.js for specific frameworks
154
-
155
-
search for ['gridstack' under NPM](https://www.npmjs.com/search?q=gridstack&ranking=popularity) for latest, more to come...
156
-
157
-
- vue.js: see [demo v3](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue3js.html) or [demo v2](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue2js.html)
- Angular9: [lb-gridstack](https://github.com/pfms84/lb-gridstack) Note: very old v0.3 gridstack instance. recommend for concept ONLY. Working on creating an Angular wrapper as that is we use ourself...
GridStack makes it very easy if you need [1-12] columns out of the box (default is 12), but you always need **2 things** if you need to customize this:
@@ -277,20 +267,31 @@ GridStack.init(options);
277
267
278
268
If you're still experiencing issues on touch devices please check [#444](https://github.com/gridstack/gridstack.js/issues/444)
279
269
270
+
# gridstack.js for specific frameworks
271
+
272
+
search for ['gridstack' under NPM](https://www.npmjs.com/search?q=gridstack&ranking=popularity) for latest, more to come...
273
+
274
+
- vue.js: see [demo v3](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue3js.html) or [demo v2](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue2js.html)
275
+
- React: [react-gridstack-example](https://github.com/Inder2108/react-gridstack-example/blob/master/src/App.js) or read on what [hooks to use](https://github.com/gridstack/gridstack.js/issues/735#issuecomment-329888796)
- Angular9: [lb-gridstack](https://github.com/pfms84/lb-gridstack) Note: very old v0.3 gridstack instance so recommend for concept ONLY. You can do component or directive. Working on exposing the Angular component wrapper we use internally.
starting in 0.6.x `change` event are no longer sent (for pretty much most nodes!) when an item is just added/deleted unless it also changes other nodes (was incorrect and causing inefficiencies). You may need to track `added|removed`[events](https://github.com/gridstack/gridstack.js/tree/develop/doc#events) if you didn't and relied on the old broken behavior.
284
285
285
-
# Migrating to v1
286
+
##Migrating to v1
286
287
287
288
v1.0.0 removed Jquery from the API and external dependencies, which will require some code changes. Here is a list of the changes:
288
289
289
-
1. see [Migrating to v0.6](#migrating-to-v06)if you didn't already
290
+
0. see previous step if not on v0.6 already
290
291
291
-
2. your code only needs to include `gridstack.all.js` and `gristack.css` (don't include other JS) and is recommended you do that as internal dependencies will change over time. If you are jquery based, see [jquery app](#jquery-application)below.
292
+
1. your code only needs to `import GridStack from 'gridstack'` or include `gridstack.all.js` and `gristack.css` (don't include other JS) and is recommended you do that as internal dependencies will change over time. If you are jquery based, see [jquery app](#jquery-application)section.
292
293
293
-
3. code change:
294
+
2. code change:
294
295
295
296
**OLD** initializing code + adding a widget + adding an event:
var grid =el.gridstack; // where el = document.querySelector('.grid-stack') or other ways...
323
324
```
324
-
Other changes
325
+
Other rename changes
325
326
326
327
```js
327
328
`GridStackUI`-->`GridStack`
@@ -333,11 +334,11 @@ Other changes
333
334
334
335
Recommend looking at the [many samples](./demo) for more code examples.
335
336
336
-
# Migrating to v2
337
+
## Migrating to v2
337
338
338
339
make sure to read v1 migration first!
339
340
340
-
v2.x is a Typescript rewrite of 1.x, removing all jquery events, using classes and overall code cleanup to support ES6 modules. Your code might need to change from 1.x
341
+
v2 is a Typescript rewrite of 1.x, removing all jquery events, using classes and overall code cleanup to support ES6 modules. Your code might need to change from 1.x
341
342
342
343
1. In general methods that used no args (getter) vs setter can't be used in TS when the arguments differ (set/get are also not function calls so API would have changed). Instead we decided to have <b>all set methods return</b> `GridStack` to they can be chain-able (ex: `grid.float(true).cellHeight(10).column(6)`). Also legacy methods that used to take many parameters will now take a single object (typically `GridStackOptions` or `GridStackWidget`).
0 commit comments