Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Trouble upgrading from v10 to v11 using migration steps provided. #3058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yvonnewat opened this issue May 27, 2025 · 1 comment · Fixed by #3060
Closed

Trouble upgrading from v10 to v11 using migration steps provided. #3058

yvonnewat opened this issue May 27, 2025 · 1 comment · Fixed by #3060

Comments

@yvonnewat
Copy link

I am having trouble implementing the migration steps provided to my code. Specifically, I cannot find a definition in the documentation for GridStack.createWidgetDivs() and the migration steps could elaborate a little more on how each of these functions will work together.

At present I am trying something similar to

let el = '<div>some block</div>`;
let widgetParams = {x: x, y: y, w: width, h: height}
let newDiv = GridStack.createWidgetDivs(widgetParams);
newDiv.innerHTML = el.content;
let gridWidget = grid.makeWidget(newDiv);

I am still getting odd behaviour from the grid elements with this and I'm not sure what about this is different from what is suggested in the migration steps. The old behaviour used addWidget like so:

let gridWidget = GridStack.addWidget(el, widgetParams);
@adumesny
Copy link
Member

adumesny commented May 27, 2025

sorry doc (which is manually updated) is missing that method.

newDiv.innerHTML = el.content;

is incorrect as you are nuking grid-stack-item-content div. instead do this:

GridStack.renderCB = function(el: HTMLElement, w: GridStackNode) {
  el.innerHTML = w.content;
};
let gridWidget = grid.addWidget({x, y, w: width, h: height, content: '<div>some block</div>'})

don't forget to donate if you find this lib useful.

adumesny added a commit to adumesny/gridstack.js that referenced this issue May 27, 2025
@adumesny adumesny mentioned this issue May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants