View has some data like which row selected or some things like typed data before submit in form. where is best place to store this data?
I think model is everything synced with server. is this ture? maybe there is new concept like modelView for storing view data
ps: my project has some modules and i expect after exit from one modules and enter again, show selected row.
Backbone does not provide a special storage for the view data. You can store it where ever you choose, here are two options:
A) Add key-values to the View:
this.currentRow = 3;B) Add a Backbone Model to the view to hold all data:
this.extraData = new Backbone.Model({currentRow : 3});this.extraData.set('currentRow', 5);this.extraData.get('currentRow');I prefer the second one, as you can use all of Backbone’s goodies like binding to changes of the currentRow. Models doesn’t have to be synced with the server (but think about syncing this to the localStorage to persist user’s state in your application).