javascript - Advanced routes in backbone.js with functional grouping -
here example of routes structure:
routes:{ "*actions" : "defaulthandler", //some default handler //handlers pages "page1" : "page1", . . . . . . . . . . "pagen" : "pagen", //and have module, it's own pages, , routes has similar look: "module/page01" : "page01", . . . . . . . . . . "module/pagenn" : "pagenn", /* , have task navigations module , trying make this: */ "module/*path" : "modulehandler" /* , it's not working, because in case on navigate, example page "module/page01" modulehandler responding, not page01 handler */ } like that. , need both handlers respond. can't find trick in documentation
you need this: https://github.com/flochip/backbone_router_filter but, of course, it's example , should implement filtering depend on route. feel free ask if encounter difficulties.
updated: i've found this: https://github.com/angelo0000/backbone_filters. if understand it's want.
var r = backbone.router.extend({ routes: { "page1": "page1", "pagen": "pagen", "module/page01": "page01", "module/pagenn": "pagenn", "*actions" : "defaulthandler" }, before: { '^module/': 'modulefilter' } //... });
Comments
Post a Comment