点击儿童时不会触发骨干事件

时间:2013-07-10 13:00:48

标签: events backbone.js triggers

我遇到骨干事件的问题。

// The DOM events //
events: {
    'click table.table-sorter th[data-column]' : 'sort'
},

<thead>
    <tr>
        <th data-column="name">name <i class="icon-sort"></i></th>
        <th>description</th>
    </tr>
</thead>

当我点击 而不是 i 时,事件就会触发。

但是如果我在渲染视图函数中使用jQuery的on函数它可以工作:

$("table.table-sorter th[data-column]").click(function(){
    <i> is trigger 
})

由于

0 个答案:

没有答案