Tag: backbone.js

Backbone.js – Other frameworks that provide Collections

I am inclined to BackboneJs for mvc structuring javascript files now. I am quite happy with the current setup and i would like to now improve my knowledge of other javascript frameworks available that is tiny in it’s core like Backbonejs, provides collection to manage array of models like Bb does. I tried SpineJs, SammyJs […]

Using Backbone.Router for a slideshow

I’m creating a slideshow using Backbone.js. My slideshow view is finished, each slide is a model and all the models are inside a collection. Now I want to apply a little hashbang magic to my slideshow 🙂 This is my code structure application.js models/slideshow/slide.js collections/slideshow/slides.js views/slideshow.js In application.js I create my router: var App = […]

Loading fullcalendar events from a backbone collection breaks the next & previous functions

noob coder here. I’m having trouble linking fullcalendar to backbone.js. My problem arises when I use the ‘previous’ and ‘next’ buttons on fullcalendar to navigate. Here is the bug: I make a new event. The event shows up on the calendar. I press ‘next’. I press ‘previous’. The new event has disappeared. It looks like […]

Weird view attribute result in backbone

I have a view in backbone and I would like to create some attributes. I did that: var ProgrammeDetailsView = Backbone.View.extend({ $infoResult: $(‘#info-result’), $castingResult: $(‘#casting-result’), $broadcastResult: $(‘#broadcast-result’), $testResult: $(‘#test’), […] And I surprisely got this result: console.log(this.$infoResult); -> Array { selector=”#test”, forEach=forEach(), reduce=reduce(), more…} As you can see, I’ve used “this.$infoResult” which should return an […]

backbone.relational – key, keySource, keyDestination

I have the following two models: User and Job. Each user can have just one job. The user.attributes and job.attributes look like these (1): (1) user.attributes = { id: 1, name: ‘barName’, job_id: 5 } job.attributes = { id: 5, name: ‘fooJob’ } Let’s suppose I want to make a relation between these two models: […]

Using functions to manage relationships in Backbone

I am working (for the first time) with Backbone.js in creating a reasonably simple application. I am currently working with two entities that have a one-to-many relationship: Project: has many groups Group: belongs to one project I looked at a few different ways of representing relationships between models, from Backbone’s own recommendations to Ligament to […]

Backbone.js – Back button (window.history.back) with label of the previous page

I’d like to display a back button with a label related to the previous page (a title or something like this) which will be called on the click event. I currently use the window.history.back() function on the event but how could I get the label ?

How do I upload an image using the Parse.com javascriptSDK?

I’m using Parse.com to build a javascript app, and I need to upload photos. I have a form which allows users to select the image on their filesystem, but what do I do with it next? I can’t find any documentation for this on the Parse site (not for the javascriptSDK, anyway). Thanks for any […]

Removing first View and Creating a second View (backbone.js)

I am working on the following feature: When a user clicks on a photo on the page, a modal modalView appears with more details of that item. In modalView, the user can click on the photo of another item, which will close the first modal window modalView and open a new modal window modalView containing […]

Blur on hidden element doesn't remove focus

I Use Chrome Version 21.0.1180.89 I have an input that i .hide() and call .blur() on. the blur event is fired, the input is not actually losing focus. Is this documented behavior? Is there a good workaround? I am building a Backbone app where data in a textfield should be saved when the user press […]