Note that there are some explanatory texts on larger screens.

plurals
  1. POBackbone Marionette ItemView's Events not triggering with specifiers
    text
    copied!<p>Have the following view :</p> <pre><code>ContactsApp.SettingsView = Backbone.Marionette.ItemView.extend({ initialize: function () { this.bindTo(this.model, "change", this.modelChanged); }, modelChanged: function (model, value) { console.log(this.model.get('search')); this.render(); }, events: { 'click .clickable': 'GoTo', 'keyup input[type=text]': 'search' }, GoTo: function (ev) { var dest = $(ev.target).data('dest'); if (dest == undefined) { return; } if (dest === "next") { this.model.nextPage(); return; } if (dest === "prev") { this.model.previousPage(); return; } this.model.set({ page: dest }); }, search : function (ev) { console.log('search'); }, template: "#additional-stuff-template" }); </code></pre> <p>And My Template : </p> <pre><code>&lt;script type="text/template" id="additional-stuff-template"&gt; &lt;span class="clickable" data-dest="1"&gt;First&lt;/span&gt;&amp;nbsp; &lt;span class="clickable" data-dest="prev"&gt;Previous&lt;/span&gt;&amp;nbsp; &lt;input type="text" value="{{ page }}" size="3" /&gt; of {{ pages}} &lt;span class="clickable" data-dest="next"&gt;Next&lt;/span&gt;&amp;nbsp; &lt;span class="clickable" data-dest="{{ pages }}"&gt;Last&lt;/span&gt; &amp;nbsp; Search : &lt;input type="text" class="search" value="{{ search }}" size="15" /&gt; &lt;/script&gt; </code></pre> <p>The events dont fire. if i change </p> <pre><code>events: { 'click .clickable': 'GoTo', 'keyup input[type=text]': 'search' }, </code></pre> <p>to </p> <pre><code>events: { 'click': 'GoTo', 'keyup': 'search' }, </code></pre> <p>I can get the click event to run but its not solely on the span's (had the same issue with anchor tags as well.</p> <p>I know this is something stupid i am doing ... </p>
 

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