Opened 14 years ago

Closed 11 years ago

#4975 closed bug (wontfix)

Dialog: Cannot modify zIndex option after init

Reported by: betobaz Owned by:
Priority: major Milestone: 1.10.0
Component: ui.dialog Version: 1.7.2
Keywords: zIndex Cc:
Blocked by: Blocking:

Description (last modified by Scott González)

.dialog('option', 'zIndex', val) doesn't do anything if the dialog is already open.

Change History (14)

comment:1 Changed 13 years ago by Jörn Zaefferer

Please provide the description in english.

comment:2 Changed 13 years ago by Scott González

Description: modified (diff)
Summary: Problema con dialog('option','zIndex',value), [Posible solucion]Dialog: Cannot modify zIndex option after init

comment:3 Changed 13 years ago by rdworth

Milestone: TBD1.8

comment:4 Changed 13 years ago by betobaz

Sorry, i'm from Mexico and i don't speaking english very well. Using UI Dialog I find that zIndex allocation does not work, in jquery-ui-1.7.2.custom, the _setData function don't have the case for zIndex. The solution that i give is the follow:

case "zIndex":

this.uiDialog.css("z-index",value); (this.overlay&&this.overlay.$el.css("z-index",--value)); break;

I hope that my contribution is helpfull

comment:5 Changed 13 years ago by spudly

I would also like to see this fixed.

The problem seems to be that _setOption is defined in the dialog widget but "zIndex" is not in the switch statement. As a result, you can neither get nor set the zIndex of the dialog. I would say this is a feature, but the documentation says this should work.

In my case, I need to modify the zindex each time the dialog is opened to ensure it opens on top.

comment:6 Changed 12 years ago by adovenmuehle

This issue seems to be fixed in 1.8.9, see http://jsfiddle.net/AVxGY/

comment:7 in reply to:  6 Changed 12 years ago by rdworth

Replying to adovenmuehle:

This issue seems to be fixed in 1.8.9, see http://jsfiddle.net/AVxGY/

Nope. Your test is only checking that the option has changed, not that the option change has actually had an effect on the ui-dialog element. See http://jsfiddle.net/rdworth/AVxGY/1/

comment:8 Changed 11 years ago by Scott González

Milestone: 1.9.01.10.0

comment:9 Changed 11 years ago by petersendidit

Status: newopen

comment:10 Changed 11 years ago by fontzter

Owner: set to fontzter
Status: openassigned

comment:11 Changed 11 years ago by fontzter

Owner: fontzter deleted
Status: assignedopen

A more extensive example is here: http://jsfiddle.net/fontzter/qjeHT/2/

This will likely be resolved in the reworking of zIndex and modality.

A possible workaround is to add the following case to the switch within the _setOption:

case "zIndex":
	this.uiDialog.css( "z-index", value );
	this.options.zIndex = value;

	// maxZ needs to be reset if the dialog is opened
	if ( this._isOpen ) {
		this.moveToTop();
	}
	break;

comment:12 Changed 11 years ago by bchiasson

Owner: set to bchiasson
Status: openassigned

comment:13 Changed 11 years ago by bchiasson

Owner: bchiasson deleted
Status: assignedopen

comment:14 Changed 11 years ago by Scott González

Resolution: wontfix
Status: openclosed
Note: See TracTickets for help on using tickets.