jquery - 在 jQuery 中显示/隐藏已经通过显示或隐藏“过滤”的表行
问题描述
我有一个由 AZ 选项卡过滤的记录集结果表。因此,当我单击字母“A”时,只有以<tr>
字母 A 开头的 's 才会从完整列表中显示出来。一切都很好,现在的问题是它需要进一步过滤。
现在我需要在所有/活动/非活动之间过滤它。我似乎无法弄清楚这一点。如何显示已经隐藏/显示行的隐藏表行?这是我用于字母过滤的代码。
$('.but_tab').on('click',function(){
$('.nav-tabs .active').removeClass('active');
var tab = $(this).attr('data-tab');
$(this).parent('li').addClass('active');
console.log(tab);
$('.t_all').hide();
$('.t_'+tab).show();
// further filter list based on whether all/active/inactive has the active class...?
filterResults();
});
function filterResults(){
var curFilter = $('.but-filter.active').attr('data-type');
//?
};
下面是表格行的代码:
<tr class="t_all t_A filter-all filter-True">
每行将包含“filter-all”和“filter-True”或“filter-False”,具体取决于它是否处于活动状态。
解决方案
推荐阅读
- asynchronous - 为什么@Asynchronous 和 Future 类不起作用
- jupyter-lab - 为笔记本设置默认工作目录而不更改源目录
- python - 从其他数据框中查找值并分配给原始数据框
- wordpress - 如何在 Wordpress 后端/编辑产品页面上禁用特定插件
- java - JBoss 上的 JBPM 安装抛出 NoClassDefFoundError: org/apache/log4j/Category
- chef-infra - 随机打乱给定列表?
- chuck - 将低频幅度调制添加到噪声中
- python - 如何提高“帧率”或文本打印速度?(文字冒险游戏)
- java - 如何使用 java 在 Program Files 中移动文件?
- angular - 不能使用 Material 组件