When the dialog element is initialized, it's moved to the end of the body,
to get around IE stacking issues. Subsequently, your selector
$(this).eq(0).parent().find('.dialogClass')
isn't finding any elements. You could just do
$('.dialogClass').dialog('open')
but I'll assume that since you're using a class, you have more than one. So
you need an association between each moreinfo element and its dialog.
Something like this:
$(".MoreInfo").each(function() {
// find dialog
var dlg = $(this).parent().find(".dialogClass");
// store reference
$(this).data("dialog", dlg);
// init dialog
dlg.dialog({
autoOpen: false,
resizable: false,
draggable: false,
position: 'top',
modal: true
});
}).click(function() {
$(this).data("dialog").dialog("open");
});
or you could use a closure:
$(".MoreInfo").each(function() {
// find dialog
var dlg = $(this).parent().find(".dialogClass").dialog({
autoOpen: false,
resizable: false,
draggable: false,
position: 'top',
modal: true
});
$(this).click(function() {
dlg.dialog('open');
});
});
Neither tested, but should give you a starting point.
- Richard
On Fri, Apr 10, 2009 at 3:38 AM, Karlos <[email protected]> wrote:
>
> Thanks Dave, it is working, but of course i can open the dialog only
> once. If i try to initialize it first
>
> $(".dialogClass'").dialog({ autoOpen: false,
> resizable: false,
> draggable: false,
> position: top,
> modal: true,
> });
> and than to open it, it is not working again:
> $(".MoreInfo").click(function() {
> $(this).eq(0).parent().find('.dialogClass').dialog
> ('open');
> });
> Where am I doing wrong?
>
> Karlos
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---