小编igu*_*der的帖子

如何在输入获得焦点时触发操作?

我想知道当输入聚焦时如何触发动作..
现在我在我的模板上使用它:{{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.

为什么?

handlebars.js ember.js

7
推荐指数
1
解决办法
5202
查看次数

日期和时间范围选择器

任何人都可以推荐我一个美好的时光(只有名字 - 例如:星期一)和时间范围选择器..

我已经尝试了http://pttimeselect.sourceforge.net/example/index.htmlhttp://haineault.com/media/jquery/ui-timepickr/page/, 但他们没有日期选择..

谁知道另一个?

html javascript jquery

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

ember.js ×1

handlebars.js ×1

html ×1

javascript ×1

jquery ×1