sencha touch :: 在搜索字段中使用ClearIcon侦听器

发布于 2024-11-24 07:50:06 字数 109 浏览 1 评论 0原文

当用户在 searchfield 中单击/点击 ClearIcon 上的选项卡时,有没有办法监听该事件?

不舒服。那么 keyup 和更改侦听器将被忽略...

thnx!

is there a way to listen to the event, when the user clicks/tabs on the clearIcon in a seachfield?

unfort. the keyup and change listeners are ignored then...

thnx!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-12-01 07:50:06

我已将以下代码放在面板的 onFirstActivate 方法上:

var clearIconEl = this.getEl().down('[class="x-field-clear-container"]');
clearIconEl.on('click', this.handleClearIconClick, this);

这会捕获清除图标单击,尽管它取决于其未记录的 css 类。

更新:
我在 sencha touch textfield clear event 中看到了针对同一问题的两个更优雅的解决方案
我想我自己会使用其中之一......

I have put the following code on the onFirstActivate method of the panel:

var clearIconEl = this.getEl().down('[class="x-field-clear-container"]');
clearIconEl.on('click', this.handleClearIconClick, this);

this catches the clear icon click, though it depends on its undocumented css class.

UPDATE:
I see two much more elegant solutions to this same problem at sencha touch textfield clear event
I think I will use one of them myself...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文