View Full Version : Using zIndex (for Masking) in a panel with two child components.

Mahesh Sakunala
23 Jul 2012, 4:53 AM
Hi Guys,
Can anyone please let me know how to use zindex in a panel which has two components as its child items.
I would like to mask one child component when the other is displayed and i am using buttons to fire this event.It would help me alot.

Thank you.

23 Jul 2012, 5:02 AM
To make sure I understand what you're trying to do, are you saying that you're trying to stack two fields on top of each other and you want to be able to move one field 'on top' of the other by changing it's z-index?

If so, here are two fairly simple solutions.

1.) Use the hide()/show() methods on each field in your button handler code.
2.) Set the parent panel to use a Card (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.layout.container.Card) layout, then dynamically switch between cards.

Mahesh Sakunala
23 Jul 2012, 5:25 AM
Hi friend,
Card layout made the trick.Thanks for your answer :)