2013-09-14 2 views
0

Marionette.Js проблемы не в состоянии добавить ясно ДивMarionette.js.append Дива ясный элемент после визуализации

Иви, что я делаю я keed того ДИВ ясно добавляется перед моими пунктами

как

списка ясно вещь вещь вещь

вот мой код

var MyItemView = Backbone.Marionette.ItemView.extend({ 
     template: tplI , 
     className: 'item', 
     tagName : 'article', 
    }); 
var myCompositeView = Backbone.Marionette.CompositeView.extend({ 
     itemView: MyItemView , 
     itemViewContainer: "#list", 
     template: tplC , 
     className : 'wikis' , 

     initialize: function() { 
      this.collection = new Collection() ; 
      this.model = new CollectionModel() ; 
      this.listenTo(this.collection, "reset", this.set); 
     }, 
     set: function (collect) { 
      this.model.set(collect.wiki) ; 
      this.render() ; 
     } , 
     onRender : function(evt){ 
      if ($.trim(this.$('#list').html()) != "") { 
       this.$('#list').append('<div class="clear"></div>') ; 
      } 
     }, 
     onClose :function() { $('#list'). 
      this.$el.height(0) ; 
     } 
    }); 

Спасибо за вашу помощь

ответ

0

Найти временную починку

на линии 1566

// Internal method to loop through each item in the 
    // collection view and show it 
    showCollection: function(){ 
    var ItemView; 
    this.collection.each(function(item, index){ 
     ItemView = this.getItemView(item); 
     this.addItemView(item, ItemView, index); 
    }, this); 
    this.triggerMethod("renderCollection", this); 
    }, 

, а затем

в целях сбора

initialize: function() { 
     //console.log('collectionView') ; 
     this.on('renderCollection' , this.collectionrendered) ; 
    }, 
collectionrendered: function(){ 
     this.$el.find(this. itemViewContainer).append('<div class="clear"></div>') ; 
     console.log('collectionrendered') ; 
    } 
Смежные вопросы