Questions tagged [chaplinjs]

Chaplin is an architecture for JavaScript applications using the Backbone.js library. Chaplin addresses Backbone’s limitations by providing a lightweight and flexible structure that features well-proven design patterns and best practices.

Key Features

  • CoffeeScript class hierarchies as well as object composition;
  • Module encapsulation and lazy-loading using AMD modules;
  • Cross-module communication using the Mediator and Publish/Subscribe patterns;;
  • Controllers for managing individual UI views;
  • Rails-style routes which map URLs to controller actions;
  • A route dispatcher and a top-level view manager;
  • Extended model, view and collection classes to avoid repetition and enforce conventions;
  • Strict memory management and object disposal;
  • A collection view for easy and intelligent list rendering.
70 questions
1
vote
1 answer

Using "mediator" as a sink in a listen-block routine

I have a ChaplinJS project built by someone else, and I'm not fully informed about certain details of the framework. Here's a bit which I'm finding tricky to grok: listen: { 'change model': 'render', 'home:actionvideo mediator': 'show' }, This…
Randy L
  • 14,384
  • 14
  • 44
  • 73
1
vote
0 answers

How do you know when all the item views in a collection view have been rendered?

I have a backbone.js/Chaplin app with the following flow: Collection view instantiated with a collection Collection is fetched from the server On sync of the collection render an "item view" for each model inside of the the collection view. This…
Rupert
  • 1,629
  • 11
  • 23
1
vote
0 answers

Chaplin.js Animated transition

Is there plugin for animated transition like this, but for Chaplin.js, not Ember? Thanks for any help.
vadim.zhiltsov
  • 9,294
  • 2
  • 15
  • 16
1
vote
1 answer

Pass model to other controller in chaplinjs with a clean url

I'm using the brunch-with-chaplinjs boilerplate with some additional libs (sinon, selenium, chai and mocha). Now i want to pass a model from a view, a collection-view to be exact, to another controller for editing. I can do this like…
Funonly
  • 818
  • 1
  • 8
  • 22
1
vote
1 answer

In Chaplin.js, how do I persist an object to the mediator?

I've seen many examples in the Chaplin.js docs, which imply that a model/object can be persisted on the mediator in the following fashion: via…
lightyrs
  • 2,809
  • 2
  • 29
  • 32
1
vote
1 answer

Chaplin Regions vs Containers and Subviews

I am having a difficult time understanding the difference between regions and containers when it comes to creating subviews. What is the use case for one over the other when creating subviews within a parent? And secondly how does registering things…
Caranicas
  • 149
  • 1
  • 11
1
vote
2 answers

Using require.js for client side dependancies in Adobe CQ5

I was wondering if anyone had experience using require.js with the Adobe CQ5 platform. I'm writing a Chaplin.js(backbone-based) single page app that will be integrated into the rest of CQ5-based site we're working on. Chaplin requires the use of a…
1
vote
1 answer

How to pass querystring data to template?

I have following controller: Controller.extend({ login: function(params,route,query){ console.log(query.query); var model = new LoginModel(); this.view = new LoginView({ region: 'main', model: model }); }, }); How…
user606521
  • 14,486
  • 30
  • 113
  • 204
1
vote
0 answers

Network error in Phonegap Android + Backbone (ChaplinJS)

When running my app on Android the index.html shows just as expected. However when i follow a route via link (i.e. movies/) i get a Application Error - A network error has occured (file:///android_asset/www/movies/). I tried different pushState…
TMichel
  • 4,336
  • 9
  • 44
  • 67
1
vote
2 answers

Chaplin/Backbone issue - "Add" event not fired when adding item to the collection

I'm building a test application for myself, to learn more about coffeescript, Backbone, Brunch.io and Chaplin JS, but I'm stuck and I can't figure out what I'm doing wrong. This is my code in the todo-view.coffee: View = require…
Stefan
  • 434
  • 1
  • 5
  • 10
1
vote
1 answer

Chaplin Backbone framework - views - how to use initialize and render methods?

I need to execute some code both on initialize and render methods, but as I understand, I canot just modfy them directly when using Chaplin - when I define my own initialize method, my routes stop working. I also tried afterInitialize() but it…
ragulka
  • 4,312
  • 7
  • 48
  • 73
1
vote
1 answer

How to get route url params in a view?

I use Backbone.js and Chaplin.js on CoffeeScript. I have a challenge. How to get url params in a routed view? routes.coffee: define -> 'use strict' (match) -> match "account/albums/:page", "accounts#albums" define [ …
I159
  • 29,741
  • 31
  • 97
  • 132
0
votes
0 answers

Backbone subview containing view template

Our project uses Backbone and Chaplin, and it contains a bunch of components with models, views and sometimes multiple templates for each component depending of the case. We are refactoring the most basic ones into smaller components that provide…
Julián Bonilla
  • 385
  • 1
  • 4
  • 18
0
votes
1 answer

$(document).ajaxError is not firing on 401

We have an error handler to post the message. $(document).ajaxError(function (e, xhr, options) { window.postMessage(....); }); One of the fetch call is returning 401 this.fetch = function(url) { return fetch(url, { …
Scorpio
  • 1,151
  • 1
  • 19
  • 37
0
votes
1 answer

Chaplin.js - Uncaught TypeError: Cannot read property 'undefined' of undefined

Sometimes I get an error like this errors. Why do they occur?
ameba
  • 1
  • 1