0

I have a case where I use tabs for different views with these routes : #view/list and #view/table, but I have filters as well which works among different views and their routes are #filter/all, #filter/key, etc.

Since my tabs have these links:

<a href="#view/list">List</a>
<a href="#view/table">Table</a>

and my filters are:

<a href="#filter/all">All</a>
<a href="#filter/key">Key</a>

what is the best way to combine the routes, so when I've opened a view then select a filter my URL should become ..#view/list/filter/key

georgiar
  • 379
  • 3
  • 7

1 Answers1

0

Right now I found a working solution for me.

I attach to the route event like:

appRouter.on('route:setFilter', function( filter ){
    appRouter.navigate('view/' + currentView + '/filter/' + filter);
});

It works for me right now. I'll be glad to see if this is not bad way to do the thinks.

georgiar
  • 379
  • 3
  • 7