I've a Backbone view where the className is set dynamically with a function:
app.Views.ItemRequestView = Backbone.View.extend({
tagName : 'tr',
className : function(){
var classRow = '';
if(this.model.getState() == app.Models.Request.status.wait.key) {
classRow = app.Models.Request.status.wait.color + ' bolder';
}
else if(this.model.getState() == app.Models.Request.status.confirm.key){
classRow = app.Models.Request.status.confirm.color + ' bolder';
}
return classRow;
},
When I update the model of the view I trigger a change event who render the view. The problem is that the className is not recalculate with the render... How can I recalculate the className when I render the view ?
Anyone have an idea ? Thanks