OptionalacceptAccept widgets dragged from other grids or from outside (default: false). Can be:
true: will accept HTML elements having 'grid-stack-item' as class attributefalse: will not accept any external widgets// Accept all grid items
acceptWidgets: true
// Accept only items with specific class
acceptWidgets: 'my-draggable-item'
// Custom validation function
acceptWidgets: (el) => {
return el.getAttribute('data-accept') === 'true';
}
http://gridstack.github.io/gridstack.js/demo/two.html for complete example
Optionalalwayspossible values (default: mobile) - does not apply to non-resizable widgets
false the resizing handles are only shown while hovering over a widget
true the resizing handles are always shown
'mobile' if running on a mobile device, default to true (since there is no hovering per say), else false.
See example
Optionalanimateturns animation on (default?: true)
Optionalautoif false gridstack will not initialize existing items (default?: true)
OptionalcellOne cell height (default: 'auto'). Can be:
Note: % values don't work correctly - see demo/cell-height.html
Optionalcellthrottle time delay (in ms) used when cellHeight='auto' to improve performance vs usability (default?: 100). A value of 0 will make it instant at a cost of re-creating the CSS file at ever window resize event!
Optionalcell(internal) unit for cellHeight (default? 'px') which is set when a string cellHeight with a unit is passed (ex: '10rem')
Optionalchildrenlist of children item to create when calling load() or addGrid()
Optionalclassadditional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance. Note: only used by addGrid(), else your element should have the needed class
Optionalcolumnnumber of columns (default?: 12). Note: IF you change this, CSS also have to change. See https://github.com/gridstack/gridstack.js#change-grid-columns. Note: for nested grids, it is recommended to use 'auto' which will always match the container grid-item current width (in column) to keep inside and outside items always the same. flag is NOT supported for regular non-nested grids.
Optionalcolumnresponsive column layout for width:column behavior
Optionaldisabledisallows dragging of widgets (default?: false)
Optionaldisabledisallows resizing of widgets (default?: false).
Optionaldraggableallows to override UI draggable options. (default?: { handle?: '.grid-stack-item-content', appendTo?: 'body' })
Optionalenginethe type of engine to create (so you can subclass) default to GridStackEngine
Optionalfloatenable floating widgets (default?: false) See example (http://gridstack.github.io/gridstack.js/demo/float.html)
Optionalhandledraggable handle selector (default?: '.grid-stack-item-content')
Optionalhandledraggable handle class (e.g. 'grid-stack-item-content'). If set 'handle' is ignored (default?: null)
Optionalitemadditional widget class (default?: 'grid-stack-item')
Optionallayoutre-layout mode when we're a subgrid and we are being resized. default to 'list'
Optionallazytrue when widgets are only created when they scroll into view (visible)
Optionalmargingap between grid item and content (default?: 10). This will set all 4 sides and support the CSS formats below an integer (px) a string with possible units (ex: '2em', '20px', '2rem') string with space separated values (ex: '5px 10px 0 20px' for all 4 sides, or '5em 10em' for top/bottom and left/right pairs like CSS). Note: all sides must have same units (last one wins, default px)
OptionalmarginOptionalmarginOptionalmarginOptionalmarginOLD way to optionally set each side - use margin: '5px 10px 0 20px' instead. Used internally to store each side.
Optionalmargin(internal) unit for margin (default? 'px') set when margin is set as string with unit (ex: 2rem')
Optionalmaxmaximum rows amount. Default? is 0 which means no maximum rows
Optionalminminimum rows amount which is handy to prevent grid from collapsing when empty. Default is 0.
When no set the min-height CSS attribute on the grid div (in pixels) can be used, which will round to the closest row.
OptionalnonceIf you are using a nonce-based Content Security Policy, pass your nonce here and GridStack will add it to the
Defines the options for a Grid