クリックイベントを削除ボタンにバインドしようとしている次のビューがありますが、何もトリガーしていないようです。コンソールでエラーが発生しません。「クリック」イベントをバインドしていないようです。
span.delete 要素は、他の要素の束の中に深くネストされています。それが重要かどうかはわかりません。直接の子要素としても試しましたが、まだうまくいきません。
var ListRow = Backbone.View.extend(
{
events:
{
'click span.delete': 'remove'
},
initialize: function()
{
_.bindAll(this, 'render', 'unrender', 'remove');
this.model.bind('remove', this.unrender);
},
render: function()
{
this.el = _.template($('#tpl-sTableList_' + key + 'Row').html());
return this;
},
unrender: function()
{
$(this.el).fadeOut();
},
remove: function()
{
this.model.destroy();
}
});