Skip to content

Commit 205bfe2

Browse files
committed
doc update
1 parent 4b8d64d commit 205bfe2

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ Join us on Slack: https://gridstackjs.troolee.com
3333
- [Requirements](#requirements)
3434
- [API Documentation](#api-documentation)
3535
- [Extend Library](#extend-library)
36-
- [gridstack.js for specific frameworks](#gridstackjs-for-specific-frameworks)
3736
- [Change grid columns](#change-grid-columns)
3837
- [Custom columns CSS](#custom-columns-css)
3938
- [Override resizable/draggable options](#override-resizabledraggable-options)
4039
- [Touch devices support](#touch-devices-support)
41-
- [Migrating to v0.6](#migrating-to-v06)
42-
- [Migrating to v1](#migrating-to-v1)
43-
- [Migrating to v2](#migrating-to-v2)
40+
- [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)
4445
- [jQuery Application](#jquery-application)
4546
- [Changes](#changes)
4647
- [The Team](#the-team)
@@ -69,7 +70,7 @@ npm install --save gridstack
6970
ES6 or Typescript
7071

7172
```js
72-
import { GridStack } from 'gridstack';
73+
import GridStack from 'gridstack';
7374
import 'gridstack/dist/gridstack.min.css';
7475
```
7576

@@ -150,17 +151,6 @@ let grid = GridStack.init();
150151
grid.printCount();
151152
```
152153

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)
158-
- React: [react gridstack example](https://github.com/Inder2108/react-gridstack-example)
159-
- ember: [ember-gridstack](https://github.com/yahoo/ember-gridstack)
160-
- 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...
161-
- AngularJS: [gridstack-angular](https://github.com/kdietrich/gridstack-angular)
162-
- Rails: [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails)
163-
164154
## Change grid columns
165155

166156
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);
277267

278268
If you're still experiencing issues on touch devices please check [#444](https://github.com/gridstack/gridstack.js/issues/444)
279269

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)
276+
- ember: [ember-gridstack](https://github.com/yahoo/ember-gridstack)
277+
- 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.
278+
- AngularJS: [gridstack-angular](https://github.com/kdietrich/gridstack-angular)
279+
- Rails: [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails)
280280

281-
# Migrating to v0.6
281+
# Migrating
282+
## Migrating to v0.6
282283

283284
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.
284285

285-
# Migrating to v1
286+
## Migrating to v1
286287

287288
v1.0.0 removed Jquery from the API and external dependencies, which will require some code changes. Here is a list of the changes:
288289

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
290291

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.
292293

293-
3. code change:
294+
2. code change:
294295

295296
**OLD** initializing code + adding a widget + adding an event:
296297
```js
@@ -321,7 +322,7 @@ grid.on('added', function(e, items) {/* items contains info */});
321322
// grid access after init
322323
var grid = el.gridstack; // where el = document.querySelector('.grid-stack') or other ways...
323324
```
324-
Other changes
325+
Other rename changes
325326
326327
```js
327328
`GridStackUI` --> `GridStack`
@@ -333,11 +334,11 @@ Other changes
333334
334335
Recommend looking at the [many samples](./demo) for more code examples.
335336
336-
# Migrating to v2
337+
## Migrating to v2
337338
338339
make sure to read v1 migration first!
339340
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
341342
342343
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`).
343344

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
"url": "git+https://github.com/gridstack/gridstack.js.git"
1010
},
1111
"scripts": {
12-
"build": "yarn --no-progress && rm -rf dist/* && grunt && webpack && tsc --stripInternal && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md",
12+
"build": "yarn --no-progress && rm -rf dist/* && grunt && webpack && tsc --stripInternal && yarn doc",
1313
"w": "rm -rf dist/* && grunt && webpack",
1414
"t": "rm -rf dist/* && grunt && tsc --stripInternal",
15+
"doc": "doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md",
1516
"test": "yarn lint && karma start karma.conf.js",
1617
"lint": "tsc --noEmit && eslint src/*.ts",
1718
"reset": "rm -rf dist node_modules",

0 commit comments

Comments
 (0)