views:

419

answers:

1

How can I create multiple modal dialogs by classname (basically the same dialogs but have a different code black attached).

One I launch a modal dialog I cannot reference the dialog anymore because jQuery will move it to the bottom of the document so something like..

$(this).find('.dialog').dialog('open');

Would not work anymore.

A: 

If I understand this question correctly, you have multiple dialogs that have the same class name and you want to be able to show them all at different times?

If this is the case then you can simply add a second class name to the class attribute which uniquely identifies the dialogs but maintains the first class giving you its look and feel.

class='dialog OpenFileDialog' and then maybe class='dialog SavePictureDialog''

So then in code you reference them by the second class name $(this).find('.OpenFileDialog').dialog('open');

Does this help?

griegs
Yes you are right this is what I want to do.. maybe I was not really clear but this reference to a portlet.. where there could be multiple instances in the same page..I guess I can count every modal dialog and give it a new idea, but it's not really a clean solution I rather have a way where it not moves the html for the modal dialog. I was hoping Jq UI supported this but maybe i am better of writing my own..
Chris