Dissable search for the Details column

This commit is contained in:
Denis-Cosmin Nutiu 2017-05-14 00:35:09 +03:00
parent 27ca97af4f
commit 13db138427

View file

@ -1,8 +1,8 @@
{% extends "root.html" %} {% extends "root.html" %}
{% block main %} {% block main %}
{{ super() }} {{ super() }}
<div class="panel panel-default"> <div class="panel panel-default">
<!-- Default panel contents --> <!-- Default panel contents -->
<div class="panel-heading"><span class="glyphicon glyphicon-globe"></span> Scoreboard</div> <div class="panel-heading"><span class="glyphicon glyphicon-globe"></span> Scoreboard</div>
<div class="panel-body"> <div class="panel-body">
@ -22,7 +22,7 @@
<tr> <tr>
<td class="hidden-xs">{{ item.name | truncate(30, True) }}</td> <td class="hidden-xs">{{ item.name | truncate(30, True) }}</td>
<td>{{ item.gpu | truncate(50) }}</td> <td>{{ item.gpu | truncate(50) }}</td>
<td>{{ item.cpu | truncate(50)}}</td> <td>{{ item.cpu | truncate(50) }}</td>
<td>{{ item.score }}</td> <td>{{ item.score }}</td>
<td><a href="{{ url_for('scoreboard.result', id=item.id) }}">See more</a></td> <td><a href="{{ url_for('scoreboard.result', id=item.id) }}">See more</a></td>
</tr> </tr>
@ -30,14 +30,20 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{super()}} {{ super() }}
<script> <script>
$(document).ready(function(){ $(document).ready(function () {
$table = $('#result-table').DataTable(); $table = $('#result-table').DataTable({
"columnDefs": [
{# Dissable search for the Details column. #}
{"searchable": false, "targets": 4}
]
}
);
$table.column('3:visible').order('desc').draw(); $table.column('3:visible').order('desc').draw();
}); });
</script> </script>