QSO live table filter

This commit is contained in:
Sebastian Lohff 2017-01-21 01:27:27 +01:00
parent 80934bda32
commit 1230e4cdc7
1 changed files with 16 additions and 1 deletions

View File

@ -55,7 +55,7 @@
</thead> </thead>
<tbody> <tbody>
{% for qso in qsos %} {% for qso in qsos %}
<tr> <tr id="qso-row-{{ forloop.counter0 }}">
<td>{{ qso.ownNo }}</td> <td>{{ qso.ownNo }}</td>
<td>{{ qso.band }}</td> <td>{{ qso.band }}</td>
<td>{{ qso.time|date:"H:i" }}</td> <td>{{ qso.time|date:"H:i" }}</td>
@ -106,7 +106,22 @@ $(document).ready(function() {
} }
} }
function filterTableCalls(e) {
var call = $("#id_call").val();
//var band = $("#id_band :selected").text();
for(var i=0; i<log.length; i++) {
console.log(log[i].call.substr(0, call.length));
if(log[i].call.substr(0, call.length) != call) {
$("#qso-row-" + i).hide();
} else {
$("#qso-row-" + i).show();
}
}
}
$("#id_call").on("input", checkForDupes); $("#id_call").on("input", checkForDupes);
$("#id_call").on("input", filterTableCalls);
$("#id_band").change(checkForDupes); $("#id_band").change(checkForDupes);
}); });