Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04906fb

Browse files
authored
Merge pull request gridstack#1192 from adumesny/develop
better doc for jquery conflict
2 parents 85889f4 + 6b35b7e commit 04906fb

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Join us on Slack: https://gridstackjs.troolee.com
3737
- [Custom columns CSS](#custom-columns-css)
3838
- [Override resizable/draggable options](#override-resizabledraggable-options)
3939
- [Touch devices support](#touch-devices-support)
40+
- [Migrating to v0.6.x](#migrating-to-v06x)
4041
- [Migrating to v1.0.0](#migrating-to-v100)
4142
- [Changes](#changes)
4243
- [The Team](#the-team)
@@ -258,11 +259,15 @@ GridStack.init(options);
258259
If you're still experiencing issues on touch devices please check [#444](https://github.com/gridstack/gridstack.js/issues/444)
259260

260261

262+
## Migrating to v0.6.x
263+
264+
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.
265+
261266
## Migrating to v1.0.0
262267

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

265-
1. your code only needs to include `gridstack.all.js` and `gristack.css` (don't include other) and is recommended you do that as internal dependencies will change. Right now jquery+jquery-ui (trimmed versions) are still being used internally for a short while.
270+
1. 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, also see note below.
266271

267272
2. code change:
268273

@@ -273,7 +278,7 @@ $('.grid-stack').gridstack(opts?);
273278
var grid = $('.grid-stack').data('gridstack');
274279

275280
// returned Jquery element
276-
grid.addWidget($('<div><div class="grid-stack-item-content"> test </div></div>'), {width: 2});
281+
grid.addWidget($('<div><div class="grid-stack-item-content"> test </div></div>'), undefined, undefined, 2, undefined, true);
277282

278283
// jquery event handler
279284
$('.grid-stack').on('added', function(e, items) {/* items contains info */});
@@ -292,8 +297,9 @@ grid.addWidget('<div><div class="grid-stack-item-content"> test </div></div>', {
292297
grid.on('added', function(e, items) {/* items contains info */});
293298

294299
```
300+
3. see [Migrating to v0.6.x](#migrating-to-v06x) if you didn't already
295301
296-
Other vars/global changes
302+
Other vars/global changes
297303
```
298304
`GridStackUI` --> `GridStack`
299305
`GridStackUI.GridStackEngine` --> `GridStack.Engine`
@@ -304,7 +310,9 @@ Other vars/global changes
304310
305311
Recommend looking at the [many samples](./demo) for more code examples.
306312
307-
We're working on implementing support for other drag'n'drop libraries through the plugin system. Right now it is still jquery-ui based (but minimal build content)
313+
**NOTE: jQuery Applications**
314+
315+
We're working on implementing HTML5 drag'n'drop through the plugin system. Right now it is still jquery-ui based. Because of that we are still bundling `jquery` (3.4.1) + `jquery-ui` (1.12.1 minimal drag|drop|resize) internally in `gridstack.all.js`. IFF your app needs to bring it's own version instead, you should **instead** include `gridstack-poly.min.js` (optional IE support) + `gridstack.min.js` + `gridstack.jQueryUI.min.js` + after you import your libs.
308316
309317
Changes
310318
=====

0 commit comments

Comments
 (0)