Skip to content

Adding widget to nested grid: Cannot set property 'isOutOfGrid' of undefined #1143

@ronvanpol

Description

@ronvanpol

In the situation where you have nested grid where both the parent grid as well as the nested grid accept widgets, adding a widget to the nest grid will result in a javascript error: Cannot set property 'isOutOfGrid' of undefined. It seems that both grids try to handle adding the new widget, while only one is able to accept the widget.

gridstack-error

I have prepared a jsfiddle: https://jsfiddle.net/ncfyau6j/1/

My temp solution was to alter the gridstack.js code. I have added the following check at the start of the function "onDrag":

    if (!draggingElement.is(self.opts.acceptWidgets)) return;

A similar check was added to the event handlers for "drop", "dropover" and "dropout":

    if (!$(ui.draggable).is(self.opts.acceptWidgets)) return;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions