简体   繁体   中英

The YUI 'valuechange' event is not fired

http://jsfiddle.net/mark69_fnd/cKWJh/

typing stuff into the text box in the aforementioned jsFiddle should open an alert window. It does not and I have no idea why.

Anyone?

您需要将“ event-valuechange”添加到use()列表中。

You need to wait until after the TabView is rendered to listen to events on DOM nodes that live inside the TabView. This is because the setter for the content attribute of each Tab is executed when rendering and that setter does:

this.get('panelNode').setContent(content);

This rewrites the innerHTML of the panel node and so you lose all references to nodes and event listeners.

Here's a quick and dirty edit of your Fiddle to show how you can put your event initialization code in a function and call it after rendering the TabView: http://jsfiddle.net/vWb5R/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM