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
1 answer

Trigger.io & Backbone-Boilerplate relative paths

I have read and seen the implementations of Trigger.io + Backbone.js - my question though is regarding using the backbone-boilerplate framework specifically. I am using Backbone-Boilerplate for my project along with the Backbone-LayoutManager by the…
1
vote
1 answer

Backbone sub-routes for tabs within a view

I have a view with two tabs. When clicking on a tab, I want to: show the tab change the hash to #view/tabName If the hash change between #view/tab1 and #view/tab2, the route won't trigger, but the view show tab2. If the hash changed from…
Trantor Liu
  • 8,770
  • 8
  • 44
  • 64
1
vote
0 answers

File structure on a backbone web application

I am working on a web application that runs through backbone and makes use of the router. On success of certain events I want to redirect users to a static success page. What is a good naming convention to clearly separate routing url paths from a…
user1473339
1
vote
2 answers

Find out what Backbone "router" is actually getting

Trying to get a backbone router to work. Having one of those situations where nothing is happening so its difficult to pinpoint the problem. Is there a way to find out what the Router is actually receiving so that I can try to pinpoint the problem…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
1
vote
3 answers

Modular Backbone.js Marionette application with router on controller - routes not working

I am currently rewriting an already existing application using the Backbone.js Marionette framework. The new stack should be fairly modular, so that new controllers could be added quite easily. The application has a node.js backend and provides a…
triplem
  • 1,324
  • 13
  • 26
1
vote
4 answers

Backbone route matching doesn't work

I have got three routes like this: var appRouter = Backbone.Router.extend({ routes: { "": "index", "questionnaire/info/id/:id": "questionnaireInfo", "questions/edit/*params": "questionEdit" }, questionnaireInfo:…
cnkt
  • 2,943
  • 5
  • 30
  • 43
1
vote
2 answers

Backbone.js Pushstate: true not returning callback function

I am pretty new to backbone js and I am having some problem getting the pushstate functionality of my app to work. Here is an eg of my route: var TodoRouter = new (Backbone.Router.extend({ routes: { "": "index", "item/add":…
Charles
  • 638
  • 2
  • 9
  • 23
1
vote
1 answer

Backbone routing change content with jquery

Im using meteor so it has its own templating method based on handlebars In most of the examples ive seen around of Backbone's method of routing they use alerts or something but im a bit confused on how to actually change the page's content I…
Tarang
  • 75,157
  • 39
  • 215
  • 276
1
vote
2 answers

Hash and backbone router

How should I make this using Router? var itemView = Marionette.ItemView.extend({ events: { 'click #loadPage': 'loadPage' }, loadPage: function () { document.location.hash = '#tasks/' + this.model.get('id'); …
Lorraine Bernard
  • 13,000
  • 23
  • 82
  • 134
1
vote
2 answers

Backbone.js read-only collection view rendering

Quick summary of my problem: first rendering of the view contains the elements in the collection, and the second rendering doesn't. Read on for details... Also of note: I do realize that the following code represents the happy path and that there is…
Bob Yexley
  • 2,704
  • 4
  • 24
  • 35
1
vote
1 answer

How should I bootstrap my web app?

I am looking for the best way to bootstrap my web app using Backbone.Marionette, Backbone.Router and Requirejs. The following implementation works but I would like to know if this is the right way to make things. Here's some of my code (*). My…
Lorraine Bernard
  • 13,000
  • 23
  • 82
  • 134
1
vote
0 answers

Backbone.js view not inserting template

I am creating user views for my Backbone/rails application. I am attempting to add a new view: /views/users/edit.js.coffee class MosaikBackbone.Views.UsersEdit extends Backbone.View template: JST['users/edit'] render: -> …
kcurtin
  • 521
  • 1
  • 6
  • 18
1
vote
1 answer

How to get this backbone route to work?

CI'm having problems with making one route works. I have list view with items, single item html looks like this:
  • 1
    vote
    2 answers

    Backbone - Create Multiple Models in Collection - serverside

    I provide a form for users to upload their own data. I use ajax-form-submit and then parse the data to create numerous models (one per row in uploaded csv). Now, I want to create models into a predefined collection. I can use add which takes an…
    cloudpre
    • 1,001
    • 2
    • 15
    • 28
    0
    votes
    1 answer

    Backbone routing with arbitrary text

    I have a page being redirected to from external to the backbone codebase. It has two parameters: ID: An integer CODE: A random printable ascii string (no # or & or ?, but can include - and always includes a /) Not sure if CODE param is %encoded or…
    Sodved
    • 8,428
    • 2
    • 31
    • 43