0

triggering the model.destroy() triggers a delete request to the server and server sents back success:true, I have an event listener on the view.model listening on destroy. after all this I can still see the model still exist on the view. and the collection also doesn't remove the model..

Updated ...

this happens only after updating the model and calling on delete on it again. if the model was there during loading it would be delete but the view still hold a link to the model. so the model is really not made null/destroyed

4

1 回答 1

1

我认为当您删除用于呈现视图的模型时,视图不会从 DOM 中删除。当模型被移除时,你必须添加一些监听器来移除视图。

view.listenToOnce(view.model, 'destroy', function(){
    view.remove();
})
于 2013-11-14T06:36:54.820 回答