Do ItemView triggers bubble up?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 16:08:25
Jesus Rodriguez

Yes, they bubble up.

The only thing to have in mind is that when an ItemView is called from a CompositeView or CollectionView, that trigger will have itemview prepended in the name, so:

click:td would be listen in the CompositeView as itemview:click:td

That string can be changed like this:

var CV = Marionette.CollectionView.extend({
  itemViewEventPrefix: "some:prefix"
});

So your trigger would be some:prefix:click:td

EDIT: On newer versions (not sure about the starting version), the prefix itemview has been changed to childview

More info here:

Marionette docs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!