骨干listenTo财产变化

时间:2015-06-22 18:03:29

标签: javascript jquery backbone.js coffeescript marionette

我有一个需要监听输入和属性更改的ItemView(对于旧的IE版本)。输入事件工作正常,但propertychange似乎没有绑定

events:
 'input .textArea': 'someFunction'
 'propertychange .textArea': 'someFunction'

当我使用onoff ex。

明确设置时,它会绑定
@textArea.on, 'input propertychange', someFunction

这只是一个无法通过ItemView的events绑定的事件吗?

虽然我知道listenTo的文档可以用于backbone.js上的事件列表。有没有办法可以通过该方法绑定两个事件。即

 @listenTo textArea, 'input properychange', someFunction

P.S我在onpropertychange中尝试了events,但也无效。此外,它需要是属性更改而不是keypress/keyup等事件

1 个答案:

答案 0 :(得分:0)

'input .textArea': 'someFunction'

不应该是

'input.textArea': 'someFunction'

代替? selecto 'input .textArea'表示在输入中有一个类名为textArea的元素。可能不是你想要的......

相关问题