Hi All,
I have a problem with using dx-popup for showing dynamic content. We have one declared dx-popup instance per application. A content of this popup is injected dynamically when the popup is displayed.
The code looks like this
<dx-popup showTitle="true" [title]="title" [(visible)]="popupVisible" >
<div *dxTemplate="let data of 'content'">
<div #dynamicComponentContainer></div>
</div>
</dx-popup>
But
<div #dynamicComponentContainer></div> is not available in the DOM in dx-popup until it's called first time.
Is it possible to fix this issue and always show the content of the popup in the DOM?
It's better to check issue on real example.
First time when a user clicks button, dynamicComponentContainer is null, but second time it works fine because dx-popup content has been added to the DOM
Yes, dxPopup initializes its content on the first opening. Set the deferRendering to false to render it immediately.
<dx-popup showTitle="true" title="Dialog" [(visible)]="popupVisible" [deferRendering]="false">
Thanks, that's what I was looking for.
Most helpful comment
Yes, dxPopup initializes its content on the first opening. Set the
deferRenderingtofalseto render it immediately.