http://jsfiddle.net/herrturtur/ExWFH/
If you want to give this a try, follow these steps:
- Click the plus button.
- Double click on the newly created name field.
- Enter information into the fields.
- Press Enter.
The era fields (from and until) will be displayed correctly, but they will not be saved (you need to reload to see the effect). Additionally, the Name field does not get updated at all.
In line 153, after setting the attributes in the NameView's close function which is triggered by an Enter-keypress, I call this.model.save()
. Here is the code snippet:
close: function(e){
this.$el.removeClass('editing');
this.model.set({
value: this.$('.name-value').val(),
from: this.model.from, // this is saved in the
until: this.model.until
});
this.model.save();
if(this.eraView.$el.attr('editing')){
this.eraView.close();
}
this.render();
},
I'm unsure what mistake I might be making, so if anyone could provide some insights, it would be greatly appreciated.
To add to the challenges, I am encountering a TypeError: Illegal Invocation error in Chrome.