PDA

View Full Version : findParentNode with no argument "crashes" ext?



fjanon
27 Jul 2007, 4:09 AM
I want to find the parent of a node, without specifying the class or HTML element. I used Ext.get(target).findParentNode() but it crashes Ext:

findParentNode with no argument seems to crash Ext, with empty string it works...

Firebug:
ss has no properties
file:///C:/Work/ext/ext-1.1-rc1/ext-all.js
Line 14

Works:


Ext.get(target).findParentNode("");

Doesn't work, generates an error inside Ext:


Ext.get(target).findParentNode();

Would it be possible to handle the no argument case as well? No sure about findParent and others where "" is an option.

Thanks

Fred

mystix
27 Jul 2007, 8:47 AM
i refer to the API for Ext.Element's findParentNode() (http://extjs.com/deploy/ext/docs/output/Ext.Element.html#findParentNode) method:
Parameters:

* selector : String
The simple selector to test
* maxDepth : Number/String/HTMLElement/Element
(optional) The max depth to search as a number or element (defaults to 10 || document.body)
* returnEl : Boolean
(optional) True to return a Ext.Element object instead of DOM node


the selector argument is not optional. it's compulsory
no argument = null/undefined is not a String. The empty string is a String.

brian.moeskau
27 Jul 2007, 9:09 AM
This is obviously not a bug. If you want to make a "feature request" that a method should handle a different signature, please post to the appropriate forum next time.