在过去的几个小时里,我一直在努力解决这个问题,我正在制作一个用于创建发票的余烬应用程序.我正在使用ember组件(textfield)使用键盘修改字段,但由于操作不会发送回相关的控制器,我无法将记录保存在focusOut或insertNewLine上,并且没有任何事情发生.我在用 :
Ember : 1.1.2
Ember Data : 1.0.0-beta.3
Handlebars : 1.0.0
jQuery : 1.9.1
Run Code Online (Sandbox Code Playgroud)
这应该是这样的:https://dl.dropboxusercontent.com/u/7311507/embercomponent.png
问题似乎在控制器或组件内,似乎我缺少一些东西.
在组件上调用console.log函数,sendAction调用永远不会...
谢谢您的帮助.
App.ItemsRoute = Ember.Route.extend({
renderTemplate: function() {
// Render default outlet
this.render();
// render extra outlets
this.render("client", { outlet: "client", into: "application"});
},
model: function() {
return this.store.find('item');
}
});
Run Code Online (Sandbox Code Playgroud)
App.ItemsController = Em.ArrayController.extend({
actions: {
createItem: function () { // NEVER GETS CALLED FROM COMPONENT
var title = "Nouvel élément"
// Create the new Todo model
var …Run Code Online (Sandbox Code Playgroud)