1

I have made simple CRUD program here.

But on click of delete (here i am trying to delete first record of model) it is not deleting any record,it is throwing error

Uncaught TypeError: Object function () {..} has no method 'deleteRecord' 

Can anyone help me to solve this issue i am struggling on this issue from last 2 days? I have posted my code here.

I have edited my fiddle to add functionality of create record (here) It is adding blank records in table. Can anyone tell me how to add/create record in this case?

    savecontact: function(){
    App.Person.createRecord({   
          fname: this.get('firstName'),
          lname: this.get('lastName'),
          contactype: 1
        });
        this.get('store').commit(); 
},
4

1 回答 1

1

基本上这条线是什么改变:

this.get('store').deleteRecord(App.Person.find(1));

你在哪里调用一个当然会引发错误deleteRecord的类定义。App.Person

请参阅此处的工作jsfiddle

希望能帮助到你。

于 2013-08-11T14:11:45.180 回答