I have a table like the following.
<table id="subtask_table" style="width: 80%">
<tr>
<th>ID</th>
<th>Titel</th>
<th>Beschreibung</th>
<th>Gemeldet von</th>
<th>Erstellt am</th>
<th>Ge?ndert am</th>
<th>Erledigt</th>
</tr>
<tr>
<td>11</td>
<td><a href="/taskExplorer/subtasks/edit/11">Termine verschieben</a></td>
<td></td>
<td></td>
<td>2012-07-26 14:34:36</td>
<td>2012-07-30 08:37:40</td>
<td>1</td>
<td><a href="/taskExplorer/subtasks/delete/11">l?schen</a></td>
</tr>
</table>
What I want to do is hide a row of this table, if the column erledigt (completed) is 0 or empty.
That's what I got this far:
$(document).ready(function() {
$('#cbHideCompleted').click(function() {
if($(this).prop('checked')) {
$('#subtask_table td').each(function() {
//if td is 'completed' column
//if value is 0 or null
//hide
});
} else {
$('#subtask_table td').each(function() {
$(this).show();
});
}
});
});
Is there a way to access the elements directly with a jquery selector. If not, how do I implement "//if td is 'completed' column"?
Thanks for your help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…