我查阅以下观点文件:
var BucketTransferView = Backbone.View.extend(
{
initialize: function(args)
{
_.bindAll(this);
this.from_bucket = args.from_bucket;
this.to_bucket = args.to_bucket;
},
events:
{
click input[type="submit"] : handleSubmit ,
},
render: function()
{
$(this.el).html(ich.template_transfer_bucket(this.model.toJSON()));
return this;
},
handleSubmit: function(e)
{
that = this;
this.model.save(
{
date: 1234567890,
amount: this.$( #amount ).val(),
from_bucket_id: this.from_bucket.get( id ),
to_bucket_id: this.to_bucket.get( id )
},
{
success: function()
{
// recalculate all bucket balances
window.app.model.buckets.trigger(
refresh ,
[that.to_bucket.get( id ), that.from_bucket.get( id )]
);
}
}
);
$.colorbox.close();
}
});
My buckets collection has this refresh method:
refresh: function(buckets)
{
that = this;
_.each(buckets, function(bucket)
{
that.get(bucket).fetch();
});
}
我的问题是,如果真的发生并改变收集模式,则不会引发具有相同模式的其他观点类别的变化。 这些观点的模型与<代码>cid相同,因此,我认为这将触发。
发生这种情况的原因是什么?