View Full Version : a panel doesn't contain the drop down list of a combo that is inside the panel

6 Nov 2010, 9:18 AM

I have a panel with a combobox inside it. When I display the values of the drop down and I position on one value I would like to test if I am still inside the panel

scope.body.on('mouseleave', function(evt) {
var relTarg = new Ext.Element(evt.getRelatedTarget());
var containerElt = Ext.getCmp('gridPanel_'+sptNbr+'_'+gridNbr).getEl();

if (!containerElt.contains(relTarg)) {

var toolBar = Ext.getCmp('toolBar_'+sptNbr+'_'+gridNbr);
var panel = Ext.getCmp('gridPanel_'+sptNbr+'_'+gridNbr);
panel.setPosition(panel.getPosition(true)[0], panel.defaultY);

When I mouseleave the panel, relTarg (the list of the combobox ) seems not to be a descendant of the panel.

Normally the combobox being inside the panel the display list should be also inside ?

How can I resolve that ?

Thank you in advance for your answers

6 Nov 2010, 10:05 AM

6 Nov 2010, 10:26 AM
Hi animal and thank you for your answer

it works only on one side that is from the combobox side . But in my case I get the ListParent Element (the relTarg element)and I would like to check if it is in my panel. There is no link from the ListParent element to the combobox

7 Nov 2010, 3:03 AM
I tried to put

getListParent: function() {
return this.getEl();

in my combobox but it doesn't work. When I click on the combobox it doesn't display any more the list.

How can I use differently this function

7 Nov 2010, 8:27 AM
I also tried without success

getListParent: function() {
return this.ownerCt;

7 Nov 2010, 9:06 AM
evt.getRelatedTarget is the element where the mouseleave event happened.

var relTarg = combo.getListParent();

Seems to be more likely what you're after.

7 Nov 2010, 9:33 AM
Hi darthwes and thank you for your answer,

Actually, I manage a mouseleave event in a panel. I get the relTarg in the handler and I would like to test if the relTarg is the ListParent of a combo that is inside the panel. The problem is that I don't know the combo. That's why I try to put also the ListParent of all my combos in the panel. In that case, it will be easier to test that the relTarg is inside the panel

8 Nov 2010, 5:37 AM
Hi, as I didn't find the solution I relaunch the post

Thank you for your answers