sproutcore - todos 教程,addbutton 在 Firefox 中没有响应
我正在测试 sproutcore todo 的教程,并且已经检查了步骤 5 中的代码,至少就我所见,它与我的代码相同,但 addButton 没有响应单击事件。
addTask: function () {
var task;
task = Sinatra.store.createRecord(Sinatra.Task, {
'description': 'New Task',
'isDone': false,
'priority': 1
});
this.selectObject(task);
this.invokeLater(function () {
var contentIndex = this.indexOf(task);
var list = Sinatra.mainPage.getPath('mainPane.middleView.contentView')
var listItem = list.itemViewForContentIndex(contentIndex);
listItem.beginEditing();
});
return YES;
主要是:
addButton: SC.ButtonView.design({
layout: { centerY: 0, height: 24, right: 12, width: 100 },
title: 'Add Task',
target: 'Sinatra.tasksController',
action: 'addTask'
}),
我看不出问题所在,请帮忙。
(我只在 kubuntu 上的 firefox 中测试过)
I'm testing the sproutcore todo's tutorial and I have checked the code in step-5 and it's identical to my code at least as far as I can see, but the addButton is not responding to click events.
addTask: function () {
var task;
task = Sinatra.store.createRecord(Sinatra.Task, {
'description': 'New Task',
'isDone': false,
'priority': 1
});
this.selectObject(task);
this.invokeLater(function () {
var contentIndex = this.indexOf(task);
var list = Sinatra.mainPage.getPath('mainPane.middleView.contentView')
var listItem = list.itemViewForContentIndex(contentIndex);
listItem.beginEditing();
});
return YES;
and in the main:
addButton: SC.ButtonView.design({
layout: { centerY: 0, height: 24, right: 12, width: 100 },
title: 'Add Task',
target: 'Sinatra.tasksController',
action: 'addTask'
}),
I can't see the problem, please help.
(I have only tested this in firefox on kubuntu)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到过类似的问题,我的解决方案是:
I have had similar problem and my solution was: