这是我的 ItemView 的代码片段:
class List.GridRow extends Backbone.Marionette.ItemView
tagName: 'tr'
triggers:
'click': 'row:clicked'
然后在我的复合视图中,我正在这样做:
class List.GridView extends Backbone.Marionette.CompositeView
template: 'mapping/list/templates/grid'
itemView: List.GridRow
itemViewContainer: 'tbody'
initialize: (options) ->
@listenTo @, 'itemview:row:clicked', (itemView, data) -> @rowClicked(itemView, data)
rowClicked: (clickedItemView, data) =>
# I need the original event information to check of the ctrl or shift key was pressed?
#if !e.ctrlKey && !e.shiftKey
我在这里要做的是将原始事件信息传递给触发器处理程序,但我还没有弄清楚?有没有办法用木偶做到这一点?我错过了什么吗?
谢谢!