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
fix for #1418
* `save(saveContent = true)` now lets you optionally save the HTML content in the node property, with load() restoring it
* `addWidget(opt)` now handles just passing a `GridStackWidget` which creates the default divs, simplifying your code. Old API still supported.
* fixed all demos and test case to use newer API
@@ -370,12 +370,13 @@ v2.x is a Typescript rewrite of 1.x, removing all jquery events, using classes a
370
370
371
371
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`).
372
372
373
-
```
373
+
```js
374
374
`addWidget(el, x, y, width, height)`-->`addWidget(el, {with: 2})`
375
-
`float()` to get value -->`getFloat()`
376
-
'cellHeight()` to get value --> `getCellHeight()`
377
-
'verticalMargin' is now 'margin' grid options and API that applies to all 4 sides.
378
-
'verticalMargin()` to get value --> `getMargin()`
375
+
// Note: in 2.1.x you can now just do addWidget({with: 2, content: "text"})
376
+
`float()`-->`getFloat()`// to get value
377
+
`cellHeight()`-->`getCellHeight()`// to get value
378
+
`verticalMargin`-->`margin`// grid options and API that applies to all 4 sides.
379
+
`verticalMargin()`-->`getMargin()`// to get value
379
380
```
380
381
381
382
2. event signatures are generic and not jquery-ui dependent anymore. `gsresizestop` has been removed as `resizestop|dragstop` are now called **after** the DOM attributes have been updated.
0 commit comments