Skip to content

The 'addWidget' function ignores data attributes #1276

@AlexanderSokolov1

Description

@AlexanderSokolov1

Subject of the issue

The data attributes are ignored during adding new widgets through the addWidget function with specified coordinates.

Your environment

  • gridstack version: 1.1.1
  • browsers: any

Steps to reproduce

https://jsfiddle.net/Alexander_Sokolov/tu03kbgv/24/

  • initialize the Grid with column=4
  • prepare the widget HTML with an attribute data-gs-width="3"
  • use the addWidget function to add new widget to the grid container with x and y coordinates:
    grid.addWidget(htmlElement, 0, 0);

Expected behaviour

The widget width is initialized from the HTML attribute (like it was in v0.4)

Actual behaviour

The data-gs-width attribute is ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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