こんにちはstackoverflowers !!!
クリックイベント後のレンダービューに問題があります:
var TablesView = Backbone.View.extend({
events: {
"click li" : "openMenuItem"
},
openMenuItem: function(e){
currentLink = $(e.currentTarget);
tableId = currentLink.data('table_id');
app.navigate("table/" + tableId + "/menus");
console.log("table/" + tableId + "/menus");
},
initialize:function () {
this.render();
},
render:function () {
var that = this;
var tables = new Tables();
tables.fetch({
success: function (tables) {
var template = _.template($('#table-template').html(), {tables: tables.models});
that.$el.html(template);
}
})
}
});
したがってli
、アドレスバーにある右のアドレスをクリックすると、アドレスバーをクリックしてEnterキーを押した場合にのみ、ビューは変更されません...(私のURL /table/:id/menusは正しく機能しますが、そうではありませんテンプレートa
リンクにある場合にのみクリックイベントで開きます)
回答ありがとうございます...よろしく