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
@@ -276,22 +276,25 @@ starting in 0.6.x `change` event are no longer sent (for pretty much most nodes!
276
276
277
277
v1.0.0 removed Jquery from the API and external dependencies, which will require some code changes. Here is a list of the changes:
278
278
279
-
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.
279
+
1.see [Migrating to v0.6.x](#migrating-to-v06x) if you didn't already
280
280
281
-
2. code change:
281
+
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, also see note below.
282
+
283
+
3. code change:
282
284
283
285
**OLD** initializing code + adding a widget + adding an event:
284
286
```js
285
287
// initialization returned Jquery element, requiring second call to get GridStack var
286
-
$('.grid-stack').gridstack(opts?);
287
-
var grid =$('.grid-stack').data('gridstack');
288
+
var grid =$('.grid-stack').gridstack(opts?).data('gridstack');
288
289
289
290
// returned Jquery element
290
291
grid.addWidget($('<div><div class="grid-stack-item-content"> test </div></div>'), undefined, undefined, 2, undefined, true);
291
292
292
293
// jquery event handler
293
294
$('.grid-stack').on('added', function(e, items) {/* items contains info */});
294
295
296
+
// grid access after init
297
+
var grid =$('.grid-stack').data('gridstack');
295
298
```
296
299
**NEW**
297
300
```js
@@ -305,9 +308,9 @@ grid.addWidget('<div><div class="grid-stack-item-content"> test </div></div>', {
305
308
// event handler
306
309
grid.on('added', function(e, items) {/* items contains info */});
307
310
311
+
// grid access after init
312
+
var grid =el.gridstack; // where el = document.querySelector('.grid-stack') or other ways...
308
313
```
309
-
3. see [Migrating to v0.6.x](#migrating-to-v06x) if you didn't already
Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
{
2
2
"name": "gridstack",
3
-
"version": "1.1.0-dev",
3
+
"version": "1.1.1-dev",
4
4
"description": "JavaScript / TypeScript for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)",
0 commit comments