Primeng: DialogService for Dynamic Dialogs

Created on 27 Jan 2017  路  13Comments  路  Source: primefaces/primeng

**I'm submitting a ...

[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://plnkr.co/edit/NtWWnN

Current behavior

  1. p-dialog does not stack by default
  2. Requrements to manually add tags into html

Expected behavior

  1. It would be nice to have stacking dialogs (or do we need to manually control z-index property?).

I like the dialog components of this library, but want to share an example in material2 for ng2 that I made as an example of behavior (especially posibility to drag dialogs). Click second dialog then open a new dialog from inside. Then you can close both (even by clicking outside of the dialog area).
https://plnkr.co/edit/RftTlTpGaOl6wDsbGy0O?p=preview

  1. The second feature request contain another question for directiveless creation of dialogs. If needed I will make a new issues but before that a small question: material2 dialogs are able to inject components into dom programatically without puting any directive into the htmls.
    In the plunker example you can find this code:
    let config = new MdDialogConfig();
    config.viewContainerRef = this.viewContainerRef;

    this.dialogRef2 = this.dialog.open(dialogsMap[key], config);

    this.dialogRef2.afterClosed().subscribe

I have seen the same for modals and loading controllers in Ionic2. How hard is to implement the same feature in p-dialog? Do you have any plans on that?

Thanks.

new feature

Most helpful comment

when could we expect the dynamic component dialog service then? we are also very much interested

All 13 comments

I agree with your 2.
I need this to easily create modal with dynamic content.
By default (with directive), if I open, close, then reopen the modal, the content will be the same. If I have a form, i need to manually reset the form in the modal when reopen.

I'd also like to have the stacking behavior.

Dialog stacks automatically, last one clicked gets on top. Idea of programmatic dialog is interesting, we have it in PrimeFaces, will check.

A good example of dynamic dialog/modal is the ionic2 ModalController, it's simple and very functionaly!
See this link to know how it work.

ng-bootstrap also has a service for opening modals: https://ng-bootstrap.github.io/#/components/modal/api.

+1

when could we expect the dynamic component dialog service then? we are also very much interested

There is another closed issue #2795 that talks about this as well, in regards to positioning the dialog when loading dynamic content. This has been a point of constant friction for me with PrimeNG dialog.

While this thread states two issues 1) proper stacking of dialogs 2) dynamic dialog service (similar to FluentUI/Bootstrap/Material. It looks like 1) is off the table. However what is the status of 2)?

Coming soon in 7.0.

Will be available in 7.0-rc1 next week.

primeng-dynamic-2

Good job!

but I think it it would be sublime if you could have the features for resize, maximize, drag as p-dialog...
and also I suggest to add the "minimizable" for both (p-dialog and dynamicdialog)

Could you tell us, if raycola suggestions are in your to do list ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadjs picture vadjs  路  39Comments

Vegim picture Vegim  路  30Comments

StevenLiekens picture StevenLiekens  路  36Comments

maplion picture maplion  路  47Comments

SpiderPork picture SpiderPork  路  70Comments