如何在Backrid.js中省略select-all事件中的复选框

时间:2016-01-12 00:37:21

标签: javascript backbone.js backgrid

在我的收藏中,有一些模型我想从被选中中排除。有没有办法让复选框无法响应select-all事件?我希望它保持checkeddisabled。我试图在Backgrid之外做这件事:

        @$el.find("tr.inactive")
        .find(":checkbox")
        .prop("disabled", true)
        .prop("checked", true)

但它在每个"backgrid:select-all"事件中都被覆盖了。

1 个答案:

答案 0 :(得分:0)

您可能需要选择所有这些内容,然后根据您不想选择的内容进行过滤。这在sql中发生了很多。类似的东西:

.filter(function( index ) {
  return !index === 'whateverSelector';
})