From ebbc4275101cbb962e0af1f85cf52a7f7f55b15c Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Thu, 17 Sep 2020 19:48:16 -0700 Subject: [PATCH] add jqueryui event bypass option documentation see #1363 --- README.md | 4 +++- doc/README.md | 2 +- src/gridstack.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23ba8f2be..55c9d386a 100644 --- a/README.md +++ b/README.md @@ -357,7 +357,9 @@ Recommend looking at the [many samples](./demo) for more code examples. 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.5.1) + `jquery-ui` (1.12.1 minimal drag|drop|resize) internally in `gridstack.all.js`. IFF your app needs to bring your 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 JQ libs. But note that there are issue with jQuery and ES6 import (see [1306](https://github.com/gridstack/gridstack.js/issues/1306)). -Note: v2.0.-rc does not currently support importing GridStack Drag&Drop without also including our jquery + jqueryui. Still trying to figure how to make that bundle possible. +Note: v2.0.0 does not currently support importing GridStack Drag&Drop without also including our jquery + jqueryui. Still trying to figure how to make that bundle possible. You will have to use 1.x + +As for events, you can still use `$(".grid-stack").on(...)` while jqueryui is used internally for things we don't support, but recommended you don't as that will get dropped at some point. ## Migrating to v2 diff --git a/doc/README.md b/doc/README.md index 6018ae8b2..08a2ac8fa 100644 --- a/doc/README.md +++ b/doc/README.md @@ -150,7 +150,7 @@ that is affected. You can call it on a single event name, or space separated list like: `grid.on('added removed change', ...)` -The Typescript `GridStackEvent` list all possible values, and nothing else is supported by the `grid.on()` method, though it's possible to register directly for other events generated by the drag&drop plugging implementation detail (currently jquery-ui based). +The Typescript `GridStackEvent` list all possible values, and nothing else is supported by the `grid.on()` method, though it's possible to register directly for other events generated by the drag&drop plugging implementation detail (currently jquery-ui based so you can still use `$(".grid-stack").on(...)`). ### added(event, items) diff --git a/src/gridstack.ts b/src/gridstack.ts index 133c15fba..8f52f2010 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -826,7 +826,7 @@ export class GridStack { // do same for start event to make it easier... this._gsEventHandler[name] = callback; } else { - console.log('gridstack.on(' + name + ') event not supported'); + console.log('GridStack.on(' + name + ') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.'); } return this; }