Ember.js textField更改事件 [英] Ember.js textField change event

查看:46
本文介绍了Ember.js textField更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始学习ember.js
为什么使用此代码 http://jsfiddle.net/ alexchetv / RVNzP / 无法正常工作-仅在MyTextField失去焦点之后才触发App.MyTextField.change()执行吗?
具有相同功能的替代代码可以按预期工作。

I just start to learn ember.js Why this code http://jsfiddle.net/alexchetv/RVNzP/ don't work properly -- App.MyTextField.change() execution is triggered only after MyTextField loses focus? Alternative code with the same functionality works as expected.

推荐答案

请记住,Ember.Views上的处理程序(更改,选择,单击等)绑定到常规HTML DOM事件。仅当输入字段失去焦点并已更改时,才在输入字段上调用 onchange,而不是在任何时候修改该值。如果您希望收到有关显示值更改的通知,则应注意值。

Keep in mind that handlers on your Ember.Views (change, select, click, etc) are bound to normal HTML DOM events. "onchange" only gets called on an input field when the field loses focus and has changed, not any time the value is modified. You should observe 'value' if you want to be notified of changes to the displayed value.

这篇关于Ember.js textField更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆