Hello stackoverflowers !!!
I have problem with render view after click event :
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);
}
})
}
});
So when I click to one of my li
I have in adress bar rigth adress but View is not changed, only when I click to adress bar and press enter ... (My url /table/:id/menus is function properly but is not opened with click event only when I have in template a
link )
Thanks for answers... Regards
You forgot to pass
trigger
option:Of course if your
app
is an instance ofBackbone.Router
:)