Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we open dialog within a dialog?

I have a button which on clicking opens jquery dialog. Inside that jquery dialog i have another button which on clicking should open yet another dialog. The 1st dialog is open correctly but the 2nd dialog is not opening. Can anybody tell me what can be the problem?

Both the dialogs are non modal. Still, the 1st one gets opened but the 2nd one doesn't.

Thanks in advance :)

like image 345
TCM Avatar asked Feb 26 '23 17:02

TCM


2 Answers

Yes it's possible. I do it all the time. Please post some code so we can see what's wrong.

Make sure you have the "stack" property set to true, like so:

var DialogOptions = {
    draggable: false,
    resizable: false,
    stack: true
};

$('selector').dialog(DialogOptions);

description from jquery documentation:

Specifies whether the dialog will stack on top of other dialogs. This will cause the dialog to move to the front of other dialogs when it gains focus.

Code examples

Initialize a dialog with the stack option specified.

$( ".selector" ).dialog({ stack: false });

Get or set the stack option, after init.

//getter
var stack = $( ".selector" ).dialog( "option", "stack" );
//setter
$( ".selector" ).dialog( "option", "stack", false );
like image 183
capdragon Avatar answered Mar 07 '23 15:03

capdragon


I dont know what a jquery dialog is but my guess here would be that the code is targeting the same block(element) when showing/creating a dialog, the dialog might have some options where you can set how it opens your dialog according to your needs look through documentation and you'll probably be good to go

look into options such as stack

if you don't post any code you cant expect anymore aid then this

like image 42
Breezer Avatar answered Mar 07 '23 15:03

Breezer