Devextreme-angular: dx-popup does not init content in DOM until you open it first time

Created on 19 Dec 2016  路  2Comments  路  Source: DevExpress/devextreme-angular

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

question

Most helpful comment

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">

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alert83 picture alert83  路  7Comments

bonejon picture bonejon  路  4Comments

Massaru picture Massaru  路  3Comments

felpel picture felpel  路  6Comments

marcelgood picture marcelgood  路  8Comments