0
不觸發createRecord新對象在我響應,我有:在數據源
Spanish.ADDWORD = SC.Responder.create({
didBecomeFirstResponder: function(responder) {
var store = this._store = Spanish.store.chain(); //buffer changes
var word = store.createRecord(Spanish.Word, {word: "", english: ""});
Spanish.addWordController.set("content",word);
//show the dialog
var pane = Spanish.getPath('addWordPage.mainPane');
pane.append();
pane.makeFirstResponder();
},
submit: function(){
this._store.commitChanges().destroy();
Spanish.makeFirstResponder(Spanish.READY);
}
}
之前,我有數據源鉤取,我用的地方,一切正常。當我點擊提交時,沒有創建新的對象,並且createRecord沒有被調用。
添加「Spanish.store.commitRecords();」使它工作! – LDK 2011-01-13 22:57:16