findParent returning HTML Element - Ext JS

本文讨论了在Ext中使用findParent方法查找元素时的一些技巧。主要介绍了如何通过设置参数来更高效地获取所需的Ext元素,避免返回HTML元素。此外,还探讨了如何合理设置查找深度以提高查找效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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?
Reply With Quote
  #2  
Old 02-28-2007, 01:26 AM
Default

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.
Reply With Quote
  #3  
Old 02-28-2007, 11:31 AM
Default

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.
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值