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
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -334,14 +334,15 @@ make sure to read v1.0.0 migration first!
334
334
335
335
v2.x is a Typescript rewrite of 1.x, removing all jquery events, using classes and overall code cleanup. Your code might need to change from 1.x
336
336
337
-
1. In general methods that used no args (getter) vs setter are not used in Typescript.
338
-
Also legacy methods that used to take tons of parameters will now take a single object (typically `GridstackOptions` or `GridStackWidget`).
337
+
1. In general methods that used no args (getter) vs setter are not used in Typescript when the arguments differ.
338
+
Also legacy methods that used to take many parameters will now take a single object (typically `GridstackOptions` or `GridStackWidget`).
339
339
340
340
```
341
341
removed `addWidget(el, x, y, width, ...)`--> use the widget options version instead `addWidget(el, {with, ...})`
342
342
`float()` to get value -->`getFloat()`
343
343
'cellHeight()` to get value --> `getCellHeight()`
344
-
'verticalMargin()` to get value --> `getVerticalMargin()`
344
+
'verticalMargin' is now 'margin' grid options and applies to all 4 sides.
345
+
'verticalMargin()` to get value --> `getMargin()`
345
346
```
346
347
347
348
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.
- add `save()` and `restore()` to serialize grids from JSON, saving all attributes (not just w,h,x,y) [1286](https://github.com/gridstack/gridstack.js/issues/1286)
43
+
- add `margin` to replace `verticalMargin` which affects both dimensions in code, rather than one in code the other in CSS.
44
+
You can now have perfect square cells (default) [723](https://github.com/gridstack/gridstack.js/issues/723)
43
45
- fix [1299](https://github.com/gridstack/gridstack.js/pull/1299) many columns round-off error
44
46
45
47
## 1.1.2 (2020-05-17)
@@ -210,7 +212,7 @@ thanks [@ermcgrat](https://github.com/ermcgrat) and others for pointing out code
210
212
## v0.2.5 (2016-03-02)
211
213
212
214
- update names to respect js naming convention.
213
-
-`cellHeight` and `verticalMargin` can now be string (e.g. '3em', '20px') (Thanks to @jlowcs).
215
+
-`cellHeight` and `margin` can now be string (e.g. '3em', '20px') (Thanks to @jlowcs).
See [example](http://gridstack.github.io/gridstack.js/demo/advance.html)
77
77
-`animate` - turns animation on (default: `false`)
78
78
-`auto` - if `false` gridstack will not initialize existing items (default: `true`)
79
-
-`cellHeight` - one cell height (default: `60`). Can be:
79
+
-`cellHeight` - one cell height (default: `auto`). Can be:
80
80
* an integer (px)
81
-
* a string (ex: '100px', '10em', '10rem', '10%')
81
+
* a string (ex: '100px', '10em', '10rem', '10%', `10vh')
82
82
* 0 or null, in which case the library will not generate styles for rows. Everything must be defined in CSS files.
83
-
*`'auto'` - height will be calculated cell square initially.
83
+
*`'auto'` - height will be square cells initially.
84
84
-`column` - number of columns (default: `12`) which can change on the fly with `column(N)` as well. See [example](http://gridstackjs.com/demo/column.html)
85
85
-`ddPlugin` - class that implement drag'n'drop functionality for gridstack. If `false` grid will be static. (default: `null` - first available plugin will be used)
86
86
-`disableDrag` - disallows dragging of widgets (default: `false`).
-`handleClass` - draggable handle class (e.g. `'grid-stack-item-content'`). If set `handle` is ignored (default: `null`)
96
96
-`itemClass` - widget class (default: `'grid-stack-item'`)
97
+
-`margin` - gap size around grid item and content (default: `10`). Can be:
98
+
* an integer (px)
99
+
* a string (ex: '2em', '20px', '2rem')
100
+
-`marginTop`: numberOrString - can set individual settings (defaults to `margin`)
101
+
-`marginRight`: numberOrString
102
+
-`marginBottom`: numberOrString
103
+
-`marginLeft`: numberOrString
97
104
-`maxRow` - maximum rows amount. Default is `0` which means no max.
98
105
-`minRow` - minimum rows amount which is handy to prevent grid from collapsing when empty. Default is `0`. You can also do this with `min-height` CSS attribute on the grid div in pixels, which will round to the closest row.
99
106
-`minWidth` - minimal width. If grid width is less than or equal to, grid will be shown in one-column mode (default: `768`)
@@ -106,9 +113,6 @@ gridstack.js API
106
113
-`row` - fix grid number of rows. This is a shortcut of writing `minRow:N, maxRow:N`. (default `0` no constrain)
107
114
-`rtl` - if `true` turns grid to RTL. Possible values are `true`, `false`, `'auto'` (default: `'auto'`) See [example](http://gridstackjs.com/demo/rtl.html)
108
115
-`staticGrid` - removes drag&drop&resize (default `false`). If `true` widgets are not movable/resizable by the user, but code can still move and oneColumnMode will still work. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container.
109
-
-`verticalMargin` - vertical gap size (default: `20`). Can be:
110
-
* an integer (px)
111
-
* a string (ex: '2em', '20px', '2rem')
112
116
113
117
## Grid attributes
114
118
@@ -273,9 +277,9 @@ starts batch updates. You will see no changes until `commit()` method is called.
273
277
274
278
re-layout grid items to reclaim any empty space.
275
279
276
-
### cellHeight(val, noUpdate)
280
+
### cellHeight(val: number, update = true)
277
281
278
-
Update current cell height. This method rebuilds an internal CSS stylesheet (unless optional noUpdate=true). Note: You can expect performance issues if
282
+
Update current cell height. This method rebuilds an internal CSS stylesheet (unless optional update=false). Note: You can expect performance issues if
0 commit comments