Note that there are some explanatory texts on larger screens.

plurals
  1. POmarionette compositeview onfetch
    primarykey
    data
    text
    <p>I am having a backbone marionette composit view as follow.</p> <p>This is the initializing method.</p> <pre><code>initialize: function(options) { log.debug("Initialize"); this.wizard = options.wizard; this.model = new Feed({ id: options.modelid }); this.modelid = options.modelid; this.collection = new Similar(); this.listenTo(this.model, "change", this.onFetch); this.listenTo(this.model, "reset", this.onFetch); this.collection.fetch({ data: { id: this.modelid }}); this.model.fetch(); }, </code></pre> <p>and this is the onFetch method</p> <pre><code>onFetch: function() { log.debug("Fetch"); this.$el.html(this.template(this.model.toJSON()));} </code></pre> <p>and this is the append method</p> <pre><code>appendHtml: function(collectionView, itemView, index) { log.debug("appendHtml"); var jsonFeed = itemView.model.toJSON(); if (this.prevFeed === null || jsonFeed.start !== this.prevFeed.start) { var date = new Date(jsonFeed.start); collectionView.$(this.itemViewContainer).append('&lt;div class="day-divider c-color box-center" &gt;&lt;h3&gt;' + moment(date).format('DD MMMM') + '&lt;/h3&gt;&lt;/div&gt;'); } collectionView.$(this.itemViewContainer).append(itemView.el); this.prevFeed = jsonFeed; }, </code></pre> <p>My collection is emptied by the onFetch function that overwrites the html content. this is my log:</p> <pre><code>DEBUG - Initialize DEBUG - Render DEBUG - appendHtml DEBUG - appendHtml DEBUG - appendHtml DEBUG - Render DEBUG - Fetch </code></pre> <p>any idea how this happen? how can i resolve?</p>
    singulars
    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