我想知道当输入聚焦时如何触发动作..
现在我在我的模板上使用它:{{view "clickinput" class="form-control" placeholder="search..." value=s action="focus"}}
这作为视图:
export default Ember.TextField.extend({
onEvent: 'focusIn',
focusIn: function() {
this.sendAction('focusIn', this, event);
}
});
Run Code Online (Sandbox Code Playgroud)
这在我的控制器上:
actions: {
focus: function() {
alert('f');
}
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用..
我在chrome上遇到此错误:Uncaught Error: Assertion Failed: The focusIn action was triggered on the component <appkit@view:clickinput::ember438>, but the action name (function superWrapper() { var ret, sup = this.__nextSuper; this.__nextSuper = superFunc; ret = func.apply(this, arguments); this.__nextSuper = sup; return ret; }) was not a string.
为什么?
任何人都可以推荐我一个美好的时光(只有名字 - 例如:星期一)和时间范围选择器..
我已经尝试了http://pttimeselect.sourceforge.net/example/index.html和http://haineault.com/media/jquery/ui-timepickr/page/, 但他们没有日期选择..
谁知道另一个?