Skip to content

init after destroy(false) doesn't work #1204

Closed

Description

Subject of the issue

A grid initialised on the DOM left by grid.destroy(false) doesn't seem to work: widgets are not draggable.

Your environment

  • version of gridstack.js 1.1.0
  • which browser and its version Chrome Version 80.0.3987.132 (Official Build) (64-bit)

Steps to reproduce

grid = GridStack.init() // works well
grid.destroy(false)
grid = GridStack.init() // widgets are no longer draggable

https://jsfiddle.net/n4f2dpv5/

Expected behaviour

Initialising a new grid (GridStack.init()) on the DOM of the destroyed one (grid.destroy(false)) should work the same way as initialising a "fresh" grid.

Activity

  1. adumesny commented on Mar 10, 2020

    @adumesny
    Member

    Hey thanks,
    did this ever worked before ?
    I assume this is a valid user case - what are you trying to do ?
    FYI you can disable grid drag/resize by making the grid fixed as well instead of 'destroying it' and re-creating, in case you didn't know.

  2. adumesny commented on Mar 11, 2020

    @adumesny
    Member

    simple possible workaround for now (there might be more issues as I discovered stuff we didn't do during destroy(false) is to call grid.enable(); after you init the second time.

    still a bug that it doesn't work out of the box.

  3. adumesny commented on Mar 11, 2020

    @adumesny
    Member

    fixed in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions