Tag: backbone.js

Optimal URL structure for Backbone.js and Backbone implementation

I’m developing a RESTful API for a Quiz app, which is going to be built with Backbone.js and Marionette. I’m quite new to backbone and was wondering what de best URL structure would be. I have the following resources: Answer, Question which contains Answers, Question Group which contains Questions, Quiz which contains Question Groups. Two […]

How to combine node.js and Java buildpack in Heroku

We have an application that is a HTML5/JavaScript frontend that communicates with a pure Java backend via REST. The JavaScript frontend relies on Backbone.js rather than Node.js. For now, this is packaged as one application, and deployed in Heroku using the standard Java buildpack. But what we want to do now is to add Grunt […]

Backbone view not refresh event

I have one view (HomeView) render template using text! plugin. This is Home view : var HomeView = Backbone.View.extend({ initialize: function() { myCart.updateQtyLabel(“qtyCart”); }, el: ‘#webbodycontainer’, events : { “click #addToCart” : function(){ myCart.addToCart(newItem); myCart.updateQtyLabel(“qtyCart”); $(“#containernewpromotion”).html(promotionItem); } }, render : function(){ this.$el.html(homePanel); $(“#containernewpromotion”).html(promotionItem); } }); This is html template : <% var items = deserializeJSONToObj(localStorage.getItem(“Cart”));%> […]

Backbone.js change event not firing

I have a lot of select boxes each having class as browse_select. I want to fire the render function whenever any option from those select boxes is changed but it didn’t fire this function. $(function(){ var Users = Backbone.Collection.extend({ url: “/app/phpscripts/services/browse_users/?” }); var UserView = Backbone.View.extend({ el: ‘.list_ctn ul’, tagName: ‘li’, events: { “change .browse_select” […]

Backbone – How to manage collection initialization when users access website through specific post?

I’m trying to create a WordPress theme using Javascript, Requirejs and Backbonejs. The entire theme is based on slide transitions between each routes. The home page displays a wallView which contains an albumCoverView for each elements of an albumsCollection. When a user clicks on an albumCoverView, he navigates to the corresponding post url (firing album […]

column-toggle not working in jquery mobile 1.3.2, backboneJS and RequireJS with $.mobile.linkBindingEnabled = false;

I am having some trouble when I open a dialog in Table: Column Toggle. I use BackboneJS, RequireJS, JQuery Mobile, Phonegap 3.0 My configuration for prevent jquery routing is: $(document).bind(“mobileinit”, function() { $.mobile.ajaxEnabled = false; $.mobile.linkBindingEnabled = false; $.mobile.hashListeningEnabled = false; $.mobile.pushStateEnabled = false; $(document).delegate(‘div[data-role=”page”]’, ‘pagehide’, function (event, ui) { $(event.currentTarget).remove(); }); }); and in […]

How to deploy pure javascript apps (on s3)?

My app is pure clientside javascript, html and images (Backbone.js, require.js, Handlebars). There is now serverside code (in fact it talks to a sinatra-app, but this is not part of my deployment). My goal is to deploy it on a good static host (like s3). I’m familiar with capistrano but i wanted to ask if […]

Backbone Collections – fetch() ,success callback not working

I am coding in Backbone Js and this is my code : var Router, UserList, Users, router, userList; $.ajaxPrefilter(function(options, originalOptions, jqXHR) { return options.url = “http://backbonejs-beginner.herokuapp.com” + options.url; }); Users = Backbone.Collection.extend({ url: ‘/users’ }); UserList = Backbone.View.extend({ el: ‘#app’, render: function() { var users; users = new Users(); return users.fetch({ success: function() { return […]

backbone collection fetch does not run anything inside the success call, but fetches all ok

I have a collection that fetches with this line: console.info(“before fetching drivesCollection”); this.drivesCollection.fetch({ success: function() { console.info(“inside fetching drivesCollection”); }, error: function(collection, response, options) { console.log(‘ERROR fetching drivesCollection ‘); } }); console.info(“after fetching drivesCollection”); the fetching works as expected, and the error callback never get’s called. I can see all models (200+) inside the collection […]

Load js files – concatenate them all

I am using Backbone / Marrionette and AMD Require.js My goal is to speed up the web application load time by concatenating all of the files. Less files I have to load, the greater the load speed. So fat I have achieved to concatenate files within the /lib folder. Those files are jQuery, underscore, backbone… […]