jquery按字段过滤;删除“;
试图在我的客户表中显示标记为“已删除”的注册表时遇到问题。当我使用jquery从值为“Yes”或“Not”的组合中选择值时,我希望动态选择这些行。你能帮我吗jquery按字段过滤;删除“;,jquery,Jquery,试图在我的客户表中显示标记为“已删除”的注册表时遇到问题。当我使用jquery从值为“Yes”或“Not”的组合中选择值时,我希望动态选择这些行。你能帮我吗 <table id="customer_data" class="table table-striped table-bordered"> <h3>Customer</h3> <thead> <tr>
<table id="customer_data" class="table table-striped table-bordered">
<h3>Customer</h3>
<thead>
<tr>
<td class="tiles">ID</td>
<td class="titles">NAME</td>
<td class="titles">PHONE</td>
<td class="titles">DELETED</td>
<td class="titles" width="10%"><a width href ="customer_management.php" class="button_new">New</a></td>
</tr>
</thead>
<?php
while($row= mysqli_fetch_array($res))
{
?>
<tr>
<td width="10%"><?php echo $row ['memo'];?></td>
<td width="50%"><?php echo $row ['name'];?></td>
<td width="30%"><?php echo $row ['phone'];?></td>
<td width="10%">
<?php if ($row['DELETED']==0){echo 'NO';} else{echo 'YES';}?>
</td>
<td width="10%"><a href ="customer_management.php?id=<?php echo $row['ID']; ?>&oper=mod" class="button">MODIFY</a></td>
</tr>
<?php
}
?>
</table>
<!-- COMBO WITH 2 VALUES, YES OR NOT, TO SELECT THE DELETED CUSTOMERS OR NOT -->
<label for="show_deleted">Show deleted customers:</label>
<select id="show_deleted" name="show_deleted">
<?php
echo "<option SELECTED value='0'>NO" ;
echo "<option value='1'>YES" ;
?>
</select>
$(document).ready(function(){
$('#customer_data').DataTable();
});
</script>
顾客
身份证件
名称
电话
删除
显示已删除的客户:
在“已删除:是/否”td中添加一个类,以便于选择(例如class=“td Deleted
):
它工作正常,但我意识到这只是在我的数据表中隐藏注册表,行并没有按此值分组。e、 g.第一页有一个“未删除”注册表,第二页有15个。有没有可能把第一页的所有行都连接起来?对不起,我不明白你的意思。你能更详细地描述一下吗?
<td class="td-deleted" width="10%">
<?php if ($row['DELETED']==0){echo 'NO';} else{echo 'YES';}?>
</td>
$(function() {
hide_deleted_rows();
$('#show_deleted').change(function(){
if ($(this).val()=='0'){
hide_deleted_rows();
}else{
$('#customer_data').find('tr').each(function(){
$(this).show();
});
}
});
});
function hide_deleted_rows(){
$('#customer_data').find('tr').each(function(){
if($(this).find('.td-deleted').html()=="YES"){
$(this).hide();
}
});
}