Backbone.js is a JavaScript framework that provides structure to RESTful web applications.

learn more… | top users | synonyms (1)

3
votes
0answers
16 views

Backbone.model based state machine

I have created a class to keep track of some internal states. You can see it as a very simple implementation of a state machine ...
0
votes
1answer
34 views

Backbone view that “starts” the application

I use the the View below to get things started. I'm not interested in Marionette. This code is what is constructed when the application first loads. It in turn loads the composite view which is ...
0
votes
0answers
26 views

large shipping form

I made a form for shipping calculator. I used backboneJS. as a result the user sees a modal window with the entered data https://jsfiddle.net/9t1cwfrv/7/ https://github.com/zlodiak/...
2
votes
1answer
30 views

Shipping calculator consisting of one field

A made a shipping calculator, which consists of one field that is validated. jsFiddle HTML: ...
1
vote
1answer
48 views

Backbone subviews and switch

ActiveWindow is like the main container and below the subviews. Router trigger activewindow.render(options) then the switch operates. Is it fine to do that Or how ...
2
votes
0answers
28 views

JavaScript AJAX page flipper

I rarely see this kind of navigating on the web. But basically I load all the content in the background and then flip pages as needed while loading user specific data via ajax. Are there any ...
2
votes
1answer
37 views

Rendering comments in a Backbone view

I want to make show/hide logic more maintainable in my codebase. Because they are too faraway located in separate js files, it hard for people to maintain. The flow in my codebase is: require....
4
votes
0answers
106 views

Secret Santa Application : Practical Interview Test

I was given a practical task as part of an interview for a front-end developer position. There is a follow up interview and I'm looking for some constructive criticism / tough love to help me prepare. ...
1
vote
1answer
81 views

Managing collection views, adding/removing views, and listening for events

I have two collections - Movies and Watchlist. Both of these have Views that output ...
4
votes
0answers
45 views

Backbone learning piece, Movie Application using Views, Collection, Models, Routes and Localstorage

I have created a Backbone Movie app as part of a learning exercise, the app is hosted on codepen although I actually have it built on my local but thought this approach would be handier for code ...
-1
votes
1answer
32 views

Backbone view for logging a user in

I'm looking for a general peer review on already working code. Just the overall structure and of course any gotchas like DRYness or logic issues. ...
1
vote
1answer
58 views

Menu visibility toggle method

I've just created a method that toggles menu visibility. At the moment I've gone with an if..else which checks my flag and acts ...
1
vote
0answers
75 views

Creation of a list of 1000 items with Backbone

I'm really new to web developing and Backbone. I would like some advices for better performance on this program I have written. I tried to write a program similar to these: React vs AngularJS vs ...
1
vote
2answers
66 views
0
votes
0answers
138 views

Dynamically create javascript object (Backbone View)

The context here is Backbone but it's a general question about dynamically creating javascript objects. I would like to pass the name of a View ('ViewX') to be created, to a function which can then ...
2
votes
0answers
57 views

Backbone/requireJs and circular dependencies

I'm trying to have a main App view with references of all my views to manage and call transitions between theses views. But, I have circular dependencies. app.js ...
1
vote
0answers
21 views

Code enhancement for existing npm package

I am trying to improve the code in the npm package. I have looked through the code but don't have any ideas how to write proper code. GitHub ...
1
vote
1answer
875 views

Backbone/Marionette form with list of inputs

Using Backbone/Marionette, I'm building a simple widget that looks like: I'm hoping to get some feedback on my approach because I think I may be doing it wrong. jsfiddle ...
0
votes
1answer
29 views

Concisely handling both arrays and Backbone.Collection as parameter

I've got a Backbone.Collection which looks like this: ...
3
votes
1answer
252 views

Lazy singleton with BackboneJS

I am trying to have a Backbone.Model which is a singleton and I wish to instantiate it lazily. I only need to support modern browsers so please do not worry about the use of ES5 getter. Is this the ...
3
votes
1answer
403 views

Unit testing Backbone Model

I would like to hear other people's opinion on how I unit tested a functionality in a Backbone Model. As you see below, the code under test, upon being called to toggle, toggles its completed state ...
6
votes
1answer
713 views

Simple JavaScript Backbone.Js tool to highlight multiple search terms

I wrote a simple JavaScript tool to highlight multiple keywords at the same time in some text. It uses different color for each keyword, and also shows the count of matches. I'm using Backbone.js ...
3
votes
1answer
966 views

Clicking child view and preventing parent view from running dblclick event

I have a parent view which has a dblclick event handler bound to it. I also have a view which is a descendant of the parent. This child view has a click event handler bound to it. Currently, my code ...
8
votes
1answer
224 views

Interactive API documentation page of a RESTful dictionary API using Backbone.js

I'm working on the interactive API documentation of a RESTful dictionary service. The page should let testers try the different API calls, by playing with the parameters using a simple web form. ...
3
votes
1answer
644 views

Validating a model and focus to the element if validation fails

I am using Backbone Marionette - I would like to set the user name and password if that passes the model validation method. I am highly confused with that. Please show me a handy approach or correct ...
7
votes
1answer
188 views

MV* Pattern for a board game

I have made a small game in Javascript, while simultaneously learn about the ever so popular model view controller. The game is this, there are 3 players(green, purple, yellow) and they have to try ...
1
vote
2answers
10k views

Updating single view on change of a model in backbone

The setup of Backbone: 1 Collection, 3 Models, 1 View for the collection, 1 View per Model. HTML: <div id="showit"></div> Template: ...
6
votes
1answer
62 views

Maintaining information about people

I would like advice if this is a good implementation of an application for maintaining information about people (first name, last name, and age). The index.html contains an empty div and 2 templates (...
2
votes
1answer
838 views

Overriding Backbone.Collection.add to enforce uniqueness on non-id property

I've overridden Backbone.Collection.add for my Collection to ensure that the Collection never has two PlaylistItems who share a Song ID. My implementation seems incredibly verbose and I was curious if ...
10
votes
1answer
115 views

Directory Searcher

This is about my first backbone.js application. It is a small directory that fetches data and presents it in a search-like UI. Here is a working (minified) example. Here is the file that handles ...
2
votes
1answer
65 views

Proper techniques for allowing many views to subscribe to window.unload?

I would like to execute code for many views whenever the window is unloaded. For instance, I could have something like this in a view's initialize: ...
3
votes
0answers
233 views

Different templates for various resource representations in Marionette

I'm making a Backbone-Marionette app with a file structure that matches restful verbs as much as possible. It looks something like this: ...
5
votes
2answers
13k views

Simple registration form with Backbone

I am trying to create simple registration form with Backbone. I need to validate fields on blur, and whole form on submit. HTML: ...
1
vote
1answer
76 views

Mixing chrome.i18n (internationalization method) into templates

I'm mixing chrome.i18n into my templates as templateHelpers with Backbone.Marionette. ...
5
votes
1answer
330 views

Backbone collection filter

I've got this Collection in my Backbone application: ...
6
votes
1answer
3k views

Avoiding RequireJS circular dependencies

My app module bootstraps a Backbone.js application. I need app to be available in every other view for easy access to router, ...
6
votes
1answer
39 views

Managing article information

I want you to give me some tips on what I could have done better and is considered "bad practice". The code works, but I think there are better ways to do stuff, so please let me know. ...
2
votes
1answer
70 views

Backbone.Collection - Ensure that at most one model has property set to true

I have a Backbone.Collection which has some models in it. Each model has a boolean property called 'special.' Only one model should be special at any given time. I've got the following to enforce ...
1
vote
0answers
130 views

Paginated Backbone.Collection subclass

This is a subclass of Backbone.Collection with a method fetchNextPage that returns a Q promise. To find out the next page's URL,...
2
votes
1answer
280 views

Need review and best practice tips for a Backbone project

I made a simple app that fetches the favourite programming language of a Github user, by simply inserting their username. The full code is uploaded on Github, please feel free to fork it from https://...
4
votes
1answer
130 views

First ever unit test. Am I headed in the right direction?

I'm learning backbone.js in parallel with unit testing. I've just made a simple model and wanted to unit test it. Do I have the right idea? I am simply making a model with some default values. <...
2
votes
1answer
117 views

Backbone subviews with non-uniform layout

I have a “featured projects” view that requires its subviews conform to a non-uniform grid: one narrow column with 3 items, then one wide column with 2 items, followed by another narrow column with 3 ...
2
votes
1answer
638 views

Rendering a large collection using BackboneJS and LoDash

I have a Playlist object which contains many PlaylistItem children. If I have 10,000 children then the UI gets blocked from ...
2
votes
1answer
987 views

Backbone Router

I am thinking of writing some online notes/book. Amongst other things, I want to use Backbone to show different sections within a chapter as separate views. In other words, I want each chapter to ...
2
votes
0answers
256 views

Backbone/ChaplinJS view with various template

I have ChaplinJS View, with template which varies according to the condition. I try to avoid switch statements, but I think it's messy at this moment. What can you advise? ...
3
votes
1answer
132 views

Paginating a Backbone collection

This is part of a class for paginating a Backbone collection. The paginateTo method is for paginating to a model id. It returns ...
3
votes
1answer
457 views

Basic Backbone application using d3

I've started my first application using backbone and have something basic up and running, backbone seems to give a lot of freedom to application design and I don't know what I'm doing right and wrong ...
12
votes
1answer
622 views

Unordered list element via templating

I'm creating an unordered list element in Backbone via Underscore templating: ...
2
votes
1answer
127 views

Validator function in Backbone

I have inside a Backbone model validate function several if statements: ...