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

Skip to content

Commit cca3d5f

Browse files
committed
resizable/draggable options
1 parent b34f303 commit cca3d5f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
4646
- [Use with knockout.js](#use-with-knockoutjs)
4747
- [Change grid width](#change-grid-width)
4848
- [Load grid from array](#load-grid-from-array)
49+
- [Override resizable/draggable options](#override-resizabledraggable-options)
4950
- [Changes](#changes)
5051
- [v0.2.3 (development version)](#v023-development-version)
5152
- [v0.2.2 (2014-12-23)](#v022-2014-12-23)
@@ -108,12 +109,14 @@ $(function () {
108109
- `animate` - turns animation on (default: `false`)
109110
- `auto` - if `false` it tells to do not initialize existing items (default: `true`)
110111
- `cell_height` - one cell height (default: `60`)
112+
- `draggable` - allows to owerride jQuery UI draggable options. (default: `{handle: '.grid-stack-item-content', scroll: true, appendTo: 'body'}`)
111113
- `handle` - draggable handle selector (default: `'.grid-stack-item-content'`)
112114
- `height` - maximum rows amount. Default is `0` which means no maximum rows
113115
- `float` - enable floating widgets (default: `false`)
114116
- `item_class` - widget class (default: `'grid-stack-item'`)
115117
- `min_width` - minimal width. If window width is less grid will be shown in one-column mode (default: `768`)
116118
- `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`)
119+
- `resizable` - allows to owerride jQuery UI resizable options. (default: `{autoHide: true, handles: 'se'}`)
117120
- `vertical_margin` - vertical gap size (default: `20`)
118121
- `width` - amount of columns (default: `12`)
119122

@@ -493,12 +496,28 @@ _.each(serialization, function (node) {
493496
});
494497
```
495498

499+
## Override resizable/draggable options
500+
501+
You can override default `resizable`/`draggable` options. For instance to enable other then bottom right resizing handle
502+
you can init gridsack like:
503+
504+
```javascript
505+
$('.grid-stack').gridstack({
506+
resizable: {
507+
handles: 'e, se, s, sw, w'
508+
}
509+
});
510+
```
511+
512+
Note: It's not recommended to enable `nw`, `n`, `ne` resizing handles. Their behaviour may be unexpected.
513+
496514

497515
Changes
498516
=======
499517

500518
#### v0.2.3 (development version)
501519

520+
- allow to override `resizable`/`draggable` options
502521
- add `disable`/`enable` methods
503522
- add `get_cell_from_pixel` (thanks to @juchi)
504523
- AMD support

0 commit comments

Comments
 (0)