I am a very beginner in backbone.js.
My page navigation looks like this:
The left navigation defines four view types, while the top navigation should update the datamodel and re-render the current view (that's what I have in mind).
I want to allow the user to bookmark the current view and category, according to his/her personal preference (and perhaps store the setting in the browser's localstorage).
The two menus can be used interchangeably, meaning that the user can decide to show a different view with the current category's model, and the user can choose a different category within the current view.
I have some trouble figuring out how I should configure my router for this in a stable way.
Note that there may be additional parameters behind this path, such as displaying an active marker on the map based on a profile_id.
Now, I had the idea of doing something like this:
var AppRouter = Backbone.Router.extend({
routes: {
":view/:category": "aggregatefunction"
}
});
But I'm pretty unsure if this will lead me to what I need.
Since I want to use the menus interchangeably and make them bookmarkable, I already get stuck on creating the links.
Can you just give me some advice regarding the structure and notify me of potential pitfalls to help me on the way?
Any supplementary advice is of course welcome as well.
Thanks
Edit
For the bonus, I would like to read a few more opinions.
I still have some trouble building and adapting the hrefs in the menu anchor tags dynamically, while at the same time being able to trigger the events (change category / or change view).
I'm looking for the most stable solution to this problem.
Accompanied with some code per illustration if that would be possible.
Thanks.