PDA

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



flamant
6 Nov 2010, 9:18 AM
Hi,

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);
toolBar.setVisible(false);
var panel = Ext.getCmp('gridPanel_'+sptNbr+'_'+gridNbr);
panel.setHeight(panel.defaultHeight);
panel.setPosition(panel.getPosition(true)[0], panel.defaultY);
panel.body.removeClass('inFrontOf');
}


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

Animal
6 Nov 2010, 10:05 AM
http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.ComboBox&member=getListParent

flamant
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

flamant
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

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



getListParent: function() {
return this.ownerCt;
}

darthwes
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.

flamant
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

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

Thank you for your answers