views:

7976

answers:

7

I have a dialog, and I have a datepicker field on the dialog.

When I open the dialog and click in the datepicker field, the datepicker panel show behind dialog.

I try more properties: zindex, stack, bgiframe, but not success.

Someone can help me?

Tks.

+21  A: 

Old Answer

z-index (note the hyphen!) is the property that matters. Make sure you set it greater than the dialogue, and make sure you set it on the correct element. Here's how we do it:

#ui-datepicker-div 
{
 z-index: 1000; /* must be > than popup editor (950) */
}

API Change - April 17, 2010

In the CSS file for the date picker, find the .ui-datepicker item and change it:

.ui-datepicker { width: 17em; padding: .2em .2em 0; z-index: 9999 !important; }

Using z-index: 9999 !important; worked in Firefox 3.5.9 (Kubuntu).

Craig Stuntz
I change the zIndex property of dialog equals 1, and use this code included per you.This post resolve my problem.Thanks.
Renato Bezerra
Just to update this answer, it now needs to be z-index:1002. The JQuery Dialog uses an inline style: `style="overflow: hidden; display: block; position: absolute; z-index: 1001; outline-color: -moz-use-text-color; outline-style: none; outline-width: 0px; height: auto; width: 350px; top: 309.5px; left: 413.5px;"`
Chris S
After a few more minutes exploration, the jQuery Dialog seems to increase its z-index each time. I'm not sure if that is a bug or not, but setting the `#ui-datepicker-div` z-index to 9999 fixes it.
Chris S
A: 

The dialog is rendered in an iframe, and is rendered on top of everything else (including dropdowns). Meanwhile the datepicker is rendered in normal HTML and positioned absolutely.

It sounds like the datepicker is being rendered absolutely relative to the parent page instead of the iframe. Have you tried placing the calendar inside the dialog as just a standard, non-absolute-positioned blog? Or you could use dropdowns instead.

Mike Robinson
Depends which dialog he is using (question doesn't say). The one we use does not use an iframe, but I can believe there are others which do.
Craig Stuntz
The dialog that I use, is a plugin of jQuery UI for version 1.3.2 of jQuery library.
Renato Bezerra
Yeah I assumed jQuery UI, which does use the iframe
Mike Robinson
A: 

As of UI version 1.7.2 ui-datepicker-div is no longer a valid css element. "ui-datepicker" seems to be the outmost wrapper and setting the z-index to 99999 is working correctly for me as far as I know

+1  A: 

for jquery-ui-1.7.2

<style type="text/css">
    .ui-datepicker
    {
        z-index: 1003; /* must be > than popup editor (1002) */
    }
</style>
yasirmturk
+1  A: 

Set this in your top of your page. It will work fine:

<style type="text/css">
.ui-datepicker {z-index:10100;}
</style>
Revathi
A: 

I got it working by calling

$("#ui-datepicker-div").css("z-index", "1003" );
Indra
A: 

for jquery-ui-1.8

<style type="text/css">
    .ui-datepicker
    {
        z-index: 1003 !important; /* must be > than popup editor (1002) */
    }
</style>

The important is needed since the datepicker has an element.style which sets z-index to 1.

Jonatan Littke