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
7
votes
2 answers

Marionette.js compared to Chaplin.js

I currently in the process of concepting a large single page web application. There will be a lot of components, so a separation of concerns is important to me. The Server is basically a REST-Server with some sugar, like sending Template Code to the…
5
votes
1 answer

Within the Chaplin js framework, what do the events prefixed with ! mean?

I have seen these events sprinkled throughout chaplin example code, but there are no explanations within the documentation or the source. It seems that it means it is a global event, that triggers an action. Is that correct? Are they just a …
2
votes
1 answer

How to avoid redundant Backbone / jQuery init with Chaplin and Browserify

Using Chaplin with Browserify and jQuery requires you to do the following: Backbone = require('backbone') $ = require('jquery') Backbone.$ = $ Chaplin = require('chaplin') This must be written EVERY TIME you require('chaplin'). If you miss this…
donaddon
  • 413
  • 2
  • 13
2
votes
1 answer

How to reload Backbone app?

I have Backbone app (also using Chaplin.js on top of Backbone) and it works correctly with pushState. At some point I want to detect that app code is changed and reload page (reload app code). The problem is that when user is in '/some/path' I would…
user606521
  • 14,486
  • 30
  • 113
  • 204
2
votes
1 answer

Brunch `require` not defined

I have an application that uses brunch, chaplin, and coffeescript for the front end. Brunch builds the application without any errors. However, when I do brunch watch --serverand navigate to http://localhost:3333, an error is generated and the page…
crlane
  • 521
  • 5
  • 16
2
votes
1 answer

How does Chaplin.js handle passing a collection to a view?

I can create a simple model like so: define(["models/base/model"], function(Model) { "use strict"; var IssueModel = Model.extend({ defaults:{ lastName: "Bob", firstName: "Doe" } }); return IssueModel; }); And then from…
Glen Selle
  • 3,966
  • 4
  • 37
  • 59
2
votes
1 answer

How to setup environment variables in Brunch

We're developing an app using Chaplin on top of brunch. We're consuming a 3rd party API and we have different tokens for development and production. I was wondering if it's possible to setup env variables in Brunch. I'd like to compile everything to…
Juanda
  • 1,648
  • 1
  • 20
  • 29
2
votes
1 answer

mediator.user is lost after route is changed manually

I am building a single-page-application with a passport local authentication. The user is authenticated and returned within app.post "/login" After the userobject is returned I save it in Chaplin.mediator.user (like seen in the facebook-example). As…
Kuno
  • 3,492
  • 2
  • 28
  • 44
1
vote
1 answer

OroCrm: Dynamic Form

I'm trying to make a form dynamic working with Oro 3.1.1 and Symfony 3.4. To make the form dynamic I post the form with ajax, use some listeners and update the page with the response html fields, as described in Symfony docs:…
Fanfan
  • 11
  • 3
1
vote
1 answer

Backbone/chaplinJS : How to check for key existence in object

{ "providerProperties": [ { "key": "hotelnum", "value": "123" }, { "key": "contract", …
Ravi Ubana
  • 397
  • 5
  • 26
1
vote
1 answer

ChaplinJS + Brunch, can I produce only one JS file?

I would like to optimize the loading time of my website which is built on Chaplin + brunch (coffeescript). How could I pack everything so that only one js file would be seen / loaded by the browser ? It is mainly a workflow question, I don't know if…
Flavien Volken
  • 19,196
  • 12
  • 100
  • 133
1
vote
1 answer

registering event handlers in Chaplin application

In a Chaplin application I have a combination of a collection view and an item view, and I need clickable buttons at both collection level and item level. The collection is represented as a table, the items as rows. The buttons are simply
Nico
  • 11
  • 2
1
vote
1 answer

Using ChaplinJS in Django project

I'm trying to build ChaplinJS in Django project. I've downloaded Chaplin Boilerplate and opened index.html in browser. Worked perfectly fine (showed chaplin example page). Then i put all files into Django project "front-end" dir and resolved all…
Andrey
  • 299
  • 1
  • 14
1
vote
0 answers

Backbone View and iFrame

I wanted to know if I am doing things in a correct way in order to avoid memory leaks. So, I have an iFrame inside a Backbone view. On click of some elements inside of that iframe I want to execute some functions inside the view. For example Let's…
1
vote
0 answers

HashNavigation in cordova wp8 hangs app

I have next code function navigate(_hash){ alert('before'); //try#1 window.location.hash = _hash; //try#2 // window.location.href=window.location.href.split("#")[0]+"#" +url; alert('after'); } navigate('someurl') the issue is…
Gena Moroz
  • 929
  • 5
  • 9
1
2 3 4 5