Questions tagged [backbone-routing]

Backbone.js is a JavaScript framework that provides structure to RESTful web applications. Backbone also includes URL fragment or History-based routing. This tag is for questions related to Backbone's routing system.

From the fine manual:

Web applications often provide linkable, bookmarkable, shareable URLs for important locations in the app. Until recently, hash fragments (#page) were used to provide these permalinks, but with the arrival of the History API, it's now possible to use standard URLs (/page). Backbone.Router provides methods for routing client-side pages, and connecting them to actions and events. For browsers which don't yet support the History API, the Router handles graceful fallback and transparent translation to the fragment version of the URL.

419 questions
1
vote
0 answers

linkbindingEnabled in 1.3.1 does not work the same as 1.3.2

I'm using Backbone and jqm. I recently upgraded jqm from 1.3.1 to 1.3.2. I'm using jquery 2.0.3. I enable and disable linkbindingEnabled based on the backbone view which is loaded. If the view has In 1.3.1 when I click the listview it works well.…
1
vote
1 answer

How to clear backbone collection before fetching new data?

Hi all i have been working on backbone application where images are being added and existing images are being deleted or edited. Now am using router for the various section like gallery, forms but when i edit something in gallery goes back to forms…
1
vote
1 answer

Backbone History back button issue of browser

I Have following routes in Backbone: routes: { // Default 's*query':'search', '*actions': 'defaultAction' }, with PushState = true Router is working fine but when i am using browser back and forward button, query is coming as…
Abhijeet Mishra
  • 443
  • 4
  • 13
1
vote
1 answer

Is it better to make Backbone.js applications single page applications?

Since Backbone's Router only work with "#", it means that it should be all in the same page. Should a BB application be only in one page and have only 1 Router?
user1834464
1
vote
1 answer

What is the proper way to allow for "subdirectories" in Backbone Marionette routers?

Here is my current router: CRM.Router = Marionette.AppRouter.extend({ appRoutes: { "customers" : "listCustomers", "customers/:id" : "showCustomer", "customers/add" : "newCustomer", …
Brandon Durham
  • 7,096
  • 13
  • 64
  • 101
1
vote
1 answer

Backbone router not triggering view change

I've been trying to solve a pretty irritating for the last couple of days now, and I'm finally admitting defeat, and appealing to SO. First I'll give an overview of what I'm trying to do, then I'll give you specifics of where I'm running into…
coder
  • 10,460
  • 17
  • 72
  • 125
1
vote
0 answers

Removing Backbone router hash when redirected

A number of pages on my site require the user to be logged in, so when he tries to access one of these pages, the page address is saved in session and the user is redirected to the login page, and after logging in he is redirected back to that…
Khalid Dabjan
  • 2,697
  • 2
  • 24
  • 35
1
vote
2 answers

AppRouter, Controller and Event handling in Marionette

I have an AMD Marionette application with an AppRouter - the AppRouter uses a simple controller object with a set of functions for all the main routes/actions in the application. In a view, after processing a form submission I want to move the user…
1
vote
1 answer

Route collision between Marionette Apps. Possible ideas/solutions?

I am in the middle of building a Marionette application and just got bit by a route collision. Being fairly new to Backbone, I am unsure of whether or not it is possible to create a {black,white}list for Marionette's AppRouter. The best leads I have…
Gary Iams
  • 55
  • 5
1
vote
1 answer

Error while using array of validator for a single attribute in backbone.validation

I am using two different messages for two different validation such as validation: { email: [{ required: true, msg: 'Please enter Email Id.' }, { pattern: 'email', msg: 'Please enter…
1
vote
1 answer

Backbone Router navigate keeps long history

I am building an application with Backbone and to go from step 1 to step 2 I make use the of the router.navigate function. Now it will go to the next page and go back etc. However every step I take will be kept in the history and every page in the…
BonifatiusK
  • 2,281
  • 5
  • 29
  • 43
1
vote
1 answer

How to keep the username - across all views in Backbone.js

In my app, i have no.of pages. each pages have a separate view for them. But in the header part i need to show the user name on all views rendering.. what would be the best practice for that.. i came across with some of options saying.. 1. render…
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247
1
vote
2 answers

Backbone Collection get(id) method

I have one main home page in my application and another page for each post that can be accessed through a list displayed in the home page.. this is how my router looks like : var AppRouter = Backbone.Router.extend({ initialize: function(){ …
s_curry_s
  • 3,332
  • 9
  • 32
  • 47
1
vote
1 answer

How to detect Backbone.History referer (history length)

I'm developing a Backbone application with multiple views, collections, etc.. It also has a router that handles permanent URL pretty well. What I'm trying to achieve is creating a "Back" button which allows user to go back window.history(-1) to a…
kernelpanic
  • 2,876
  • 3
  • 34
  • 58
1
vote
1 answer

Routing with slashes in Backbone

I am trying to use pushState routing in Backbone.js The problem is that when I try to use routes which contain slashes in between the links, the router function wouldn't get called and the console would show an error: var Router =…