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 860d255

Browse files
committed
more GridStack.updateCB
use of gridstack#3061
1 parent cae3467 commit 860d255

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎angular/projects/lib/src/lib/gridstack.component.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
126126
if (!GridStack.saveCB) {
127127
GridStack.saveCB = gsSaveAdditionalNgInfo;
128128
}
129+
if (!GridStack.updateCB) {
130+
GridStack.updateCB = gsUpdateNgComponents;
131+
}
129132
this.el._gridComp = this;
130133
}
131134

@@ -315,3 +318,12 @@ export function gsSaveAdditionalNgInfo(n: NgGridStackNode, w: NgGridStackWidget)
315318
//.... save any custom data
316319
}
317320
}
321+
322+
/**
323+
* track when widgeta re updated (rather than created) to make sure we de-serialize them as well
324+
*/
325+
export function gsUpdateNgComponents(n: NgGridStackNode) {
326+
const w: NgGridStackWidget = n;
327+
const gridItem = (n.el as GridItemCompHTMLElement)?._gridItemComp;
328+
if (gridItem?.childWidget && w.input) gridItem.childWidget.deserialize(w);
329+
}

0 commit comments

Comments
(0)

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