Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 26348e6

Browse files
committed
doc update
fix gridstack#3058
1 parent 25c015e commit 26348e6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎README.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,15 +477,18 @@ breaking change:
477477
478478
**Breaking change:**
479479
480+
* V11 add new `GridStack.renderCB` that is called for you to create the widget content (entire GridStackWidget is passed so you can use id or some other field as logic) while GS creates the 2 needed parent divs + classes, unlike `GridStack.addRemoveCB` which doesn't create anything for you. Both can be handy for Angular/React/Vue frameworks.
481+
* `addWidget(w: GridStackWidget)` is now the only supported format, no more string content passing. You will need to create content yourself as shown below, OR use `GridStack.createWidgetDivs()` to create parent divs, do the innerHtml, then call `makeWidget(el)` instead.
480482
* if your code relies on `GridStackWidget.content` with real HTML (like a few demos) it is up to you to do this:
481483
```ts
482484
// NOTE: REAL apps would sanitize-html or DOMPurify before blinding setting innerHTML. see #2736
483485
GridStack.renderCB = function(el: HTMLElement, w: GridStackNode) {
484486
el.innerHTML = w.content;
485487
};
488+
489+
// now you can create widgets like this again
490+
let gridWidget = grid.addWidget({x, y, w, h, content: '<div>My html content</div>'});
486491
```
487-
* V11 add new `GridStack.renderCB` that is called for you to create the widget content (entire GridStackWidget is passed so you can use id or some other field as logic) while GS creates the 2 needed parent divs + classes, unlike `GridStack.addRemoveCB` which doesn't create anything for you. Both can be handy for Angular/React/Vue frameworks.
488-
* `addWidget(w: GridStackWidget)` is now the only supported format, no more string content passing. You will need to create content yourself (`GridStack.createWidgetDivs()` can be used to create parent divs) then call `makeWidget(el)` instead.
489492
490493
**Potential breaking change:**
491494

‎doc/CHANGES.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Change log
55
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
66
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
77

8-
- [12.1.2-dev (2024年05月07日)](#1212-2024年05月07日)
8+
- [12.1.2-dev (2024年05月07日)](#1212-dev-2024年05月07日)
99
- [12.1.1 (2024年04月28日)](#1211-2024年04月28日)
1010
- [12.1.0 (2024年04月23日)](#1210-2024年04月23日)
1111
- [12.0.0 (2025年04月12日)](#1200-2025年04月12日)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /