Skip to content Skip to sidebar Skip to footer

Weird Behavior Of Marionettejs Compositeview

I am working with MarionetteJS compositeView. For some reason i am getting a recursive template behavior. Usually the itemView's template is rendered within the itemViewContainer b

Solution 1:

This happens when marionette can't find your itemView. For example, if you specify the itemView before you actually define it, it won't be found. When you don't specify an itemView ( or its not found), the default behavior kicks in, which is to use the same compositeView as the itemView, to create a recursive tree structure.

To fix this, define the itemView before using it in the compositeView declaration.


IV = Marionette.ItemView.extend({ /* ... */ });

CV = Marionette.CompositeView.extend({
  itemView: IV,
  // ...
});

Post a Comment for "Weird Behavior Of Marionettejs Compositeview"