Note that there are some explanatory texts on larger screens.

plurals
  1. PORequireJS + BackboneJS - connect modules
    primarykey
    data
    text
    <p>I have a problem when I try to connect two modules containing two different views of BackboneJS.</p> <p>In this module of RequireJS contains a view of backbone. I need within this module, refer to another view of backbone that is in another module. I modified the code to make it simpler</p> <pre><code>define (["jquery","backbone","collections/controlSearchCollection","views/currentPlaylist","jqueryUI"], function($, Backbone, controlSearchMusic, currentPlaylist){ var searchModule = Backbone.View.extend({ el: "#containerSearch", initialize: function () { this.collection = new controlSearchMusic(); }, events:{ "dblclick li":"select" }, select: function(element){ var trackJSON ={}; trackJSON["id"]= "playCloud_"+$(element.target).attr("id"); currentPlaylist.collection.add(trackJSON); &lt;--- Here is where this error } }); return searchModule; }); </code></pre> <p>Here, my other module of RequireJS containing a view of backboneJS. i need add to JSON from the first module.</p> <pre><code>define (["jquery","backbone","collections/controlCurrentPlaylistCollection","jqueryUI"], function($, Backbone, controlCurrentPlaylist){ var currentPlaylist = Backbone.View.extend({ el: "#currentPlaylist", initialize: function(){ this.collection = new controlCurrentPlaylist(); this.collection.on("add", this.executeFunction, this); }, executeFunction: function(song){ alert(song.toSource()); } }); return currentPlaylist; }); </code></pre> <p>the two modules are instantiated in app.js</p> <p>Someone can help me? Thanks you!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload