Skip to content

Commit 20ed164

Browse files
committed
added DDDragInOpt
1 parent 89f1d76 commit 20ed164

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

doc/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ gridstack.js API
66
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
77

88
- [Grid Options](#grid-options)
9+
- [DDDragInOpt](#dddraginopt)
10+
- [DDDragInOpt extends DDDragOpt](#dddraginopt-extends-dddragopt)
911
- [Grid attributes](#grid-attributes)
1012
- [Item Options](#item-options)
1113
- [Item attributes](#item-attributes)
@@ -96,11 +98,11 @@ gridstack.js API
9698
- `dragIn` - specify the class of items that can be dragged into grids
9799
* example: `dragIn: '.newWidget'`.
98100
* **Note**: if you have multiple grids, it's best to call `GridStack.setupDragIn()` with same params as it only need to be done once.
99-
- `dragInOptions` - options for items that can be dragged into grids
101+
- `dragInOptions` - options for items that can be dragged into grids - see `DDDragInOpt`
100102
* example `dragInOptions: { appendTo: 'body', helper: 'clone', handle: '.grid-stack-item-content' }`
101103
* **Note**: if you have multiple grids, it's best to call `GridStack.setupDragIn()` with same params as it only need to be done once.
102104
* **Note2**: instead of 'clone' you can also pass your own function (get passed the event).
103-
- `draggable` - allows to override draggable options. (default: `{handle: '.grid-stack-item-content', appendTo: 'body'}`)
105+
- `draggable` - allows to override draggable options - see `DDDragOpt`. (default: `{handle: '.grid-stack-item-content', appendTo: 'body'}`)
104106
- `dragOut` to let user drag nested grid items out of a parent or not (default false) See [example](http://gridstackjs.com/demo/nested.html)
105107
- `engineClass` - the type of engine to create (so you can subclass) default to GridStackEngine
106108
- `float` - enable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html)
@@ -128,6 +130,14 @@ gridstack.js API
128130
- `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 can use the smaller gridstack-static.js lib. A CSS class `grid-stack-static` is also added to the container.
129131
- `styleInHead` - if `true` will add style element to `<head>` otherwise will add it to element's parent node (default `false`).
130132

133+
### DDDragInOpt
134+
- `handle`?: string - class selector of items that can be dragged. default to '.grid-stack-item-content'
135+
- `appendTo`?: string - default to 'body' (TODO: is this even used anymore ?)
136+
- `pause`?: boolean | number - if set (true | msec), dragging placement (collision) will only happen after a pause by the user. Note: this is Global
137+
138+
### DDDragInOpt extends DDDragOpt
139+
- `helper`?: string | ((event: Event) => HTMLElement) - helper function when dropping (ex: 'clone' or your own method)
140+
131141
## Grid attributes
132142

133143
most of the above options are also available as HTML attributes using the `gs-` name prefix with standard dash lower case naming convention (ex: `gs-column`, `gs-min-row`, `gs-static`, etc..).

0 commit comments

Comments
 (0)