Skip to content
Snippets Groups Projects
Commit 131ccdca authored by Alexis Thinardon's avatar Alexis Thinardon
Browse files

Add filter in list, #286

parent 009df2f4
No related branches found
No related tags found
1 merge request!166Develop
...@@ -22,6 +22,37 @@ ...@@ -22,6 +22,37 @@
<div class="box-body"> <div class="box-body">
<table id="table" class="table table-bordered table-hover"> <table id="table" class="table table-bordered table-hover">
<thead> <thead>
<tr>
<th>
<input class="form-control" type="text" id="search_utilisateur" placeholder="Utilisateur" style="width: 100%;">
</th>
<th>
<input class="form-control" type="text" id="search_collectivite" placeholder="Collectivité" style="width: 100%;">
</th>
<th>
<input class="datepicker form-control" type="text" id="search_date" placeholder="Date" style="width: 100%;">
</th>
<th>
<select class="form-control" id="search_sujet" style="width: 100%;">
<option value="">Sujet</option>
{% for key, priority in dictionary('reporting_log_journal_subject') %}
<option value="{{ key }}">{{ priority }}</option>
{% endfor %}
</select>
</th>
<th>
<select class="form-control" id="search_action" style="width: 100%;">
<option value="">Action</option>
{% for key, priority in dictionary('reporting_log_journal_action') %}
<option value="{{ key }}">{{ priority }}</option>
{% endfor %}
</select>
</th>
<th>
<input class="form-control" type="text" id="search_last_know_name" placeholder="Nom" style="width: 100%;">
</th>
<th></th>
</tr>
<tr> <tr>
<th>Utilisateur</th> <th>Utilisateur</th>
<th>Collectivité</th> <th>Collectivité</th>
...@@ -41,6 +72,33 @@ ...@@ -41,6 +72,33 @@
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-throttle-debounce/1.1/jquery.ba-throttle-debounce.js"></script>
{{ include('_Utils/_serverside_datatable.html.twig') }} {{ include('_Utils/_serverside_datatable.html.twig') }}
<script>
$(document).ready(function() {
$('#table_filter').hide();
var oTable = $('#table').DataTable();
$('#search_utilisateur').keyup($.debounce(250, function(){
oTable.column('0').search($(this).val()).draw() ;
}));
$('#search_collectivite').keyup($.debounce(250, function(){
oTable.column('1').search($(this).val()).draw() ;
}));
$('#search_date').change(function(){
oTable.column('2').search($(this).val()).draw() ;
});
$('#search_sujet').change(function(){
oTable.column('3').search($(this).val()).draw() ;
});
$('#search_action').change(function(){
oTable.column('4').search($(this).val()).draw() ;
});
$('#search_last_know_name').keyup($.debounce(250, function(){
oTable.column('5').search($(this).val()).draw() ;
}));
} );
</script>
{% endblock %} {% endblock %}
...@@ -81,4 +81,4 @@ ...@@ -81,4 +81,4 @@
"recordsTotal": {{ totalLogs }} "recordsTotal": {{ totalLogs }}
}); });
}); });
</script> </script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment