Assuming I read the current (rev 5) Docs correctly, I was hoping I could use findParent("table", true) and receive an Ext.element back. However, it seems to return an HTML Element unless I also specify the depth. findParent("table", 10, true)
Wouldn't it make more sense to switch the last two params so that I don't have to specify the depth all the time?
Wouldn't it make more sense to switch the last two params so that I don't have to specify the depth all the time?

|
#2
|
|
Just a little peek at the source helps here!
It's the third parameter that you should set to true. The second is the maximum number of steps up the parent axis to look. ![]() |
|
#3
|
|
martin, pass null for depth if you don't need it. returnElement was an addition to the function after it already existed and changing the signature was not an option.
![]() |
本文讨论了在Ext中使用findParent方法查找元素时的一些技巧。主要介绍了如何通过设置参数来更高效地获取所需的Ext元素,避免返回HTML元素。此外,还探讨了如何合理设置查找深度以提高查找效率。

被折叠的 条评论
为什么被折叠?



