View Full Version : [SOLVED]the method Ext.Element.findParent doesn't seem to always work

11 Nov 2010, 10:45 AM
I have a panel with a mouseleave handler

When I mouseleave the panel, I want to check if the relatedTarget is a menu or a List of a combo.

The check for the menu works in all cases. But the check for the list of a combo works only from times to times.

To test if I leave the panel for a List of combo, I implement relatedTarget.findParent('div.x-combo-list') that should return the matching DOM node. I tested it and most of the time the return result is null . Maybe I am doing something wrong.

Here is the code :

scope.body.on('mouseleave', function(evt) {
var relTarg = new Ext.Element(evt.getRelatedTarget());
var result1 = relTarg.findParent('div.x-menu');
var result2 = relTarg.findParent('div.x-combo-list');
Thank you in advance for your answers

11 Nov 2010, 11:21 AM
I found the solution. In fact when I enter the list of combo, I enter the html element div.x-shadow

My test is then : var result3 = relTarg.findParent('div.x-shadow');