Category: backbone

Backbone Collection Flexible Value Sorting Solution 0

Backbone Collection Flexible Value Sorting Solution

Model/Collection Declaration Inputs.Collection = Backbone.Collection.extend({ model: Inputs.Model, url: "/apis/v2/inputs", sortAttribute: "name", // supported attributes are model's element names + any custom strategies below comparator: function(model) { return Utils.genericComparator.call(this, model); }, strategies: {}, changeSort: function...

Backbone bootstrap model validations 0

Backbone bootstrap model validations

Scenario We have fields that needs to be validated. We already highlight the erroneous field(s) and display a specific message below each erroneous field. Now we want to display a popup notification on the...

Backbone after all render 0

Backbone after all render

views["#content-view"].render().once("afterRender", function() { // console.log("rendered"); $(window).trigger('scroll.rpinnable'); }, this);

Callback after all child views have rendered 0

Callback after all child views have rendered

This is something that has troubled me for long time. Whenever the parent's view afterRender() fired, the child views had not yet rendered. Thus it seemed impossible to know when all child views had...

Backbone LayoutManager view not rendering 0

Backbone LayoutManager view not rendering

Troubleshooting #1 - Did everything load in the network debugger window ? Missing one or several template views could cause the whole UI not to render #2 - Any Javascript errors in Console ?...

Add GET parameter to a backbone fetch model 0

Add GET parameter to a backbone fetch model

Fetch model with GET parameters in URL The solution is to add data: $.param({ mySuperVariableName: 1}) in the fetch options. Folders.data.fetch( { data: $.param({ showContent: 1}), success:function(model, response, options) { //model.deferred.resolve(); }, error:function(model, response, options) {...