pannello filtri in dialog

This commit is contained in:
boyska 2020-09-30 00:47:59 +02:00
parent 509d3bd47a
commit d6afc92aee
2 changed files with 20 additions and 4 deletions

View file

@ -52,6 +52,7 @@ function viewMap () {
} }
jQuery(function ($) { jQuery(function ($) {
var dateFormat = "yy-mm-dd"; var dateFormat = "yy-mm-dd";
$('.btn').button()
function getDate( element ) { function getDate( element ) {
var date; var date;
try { try {
@ -77,5 +78,9 @@ jQuery(function ($) {
).on("change", function() { ).on("change", function() {
from.datepicker("option", "maxDate", getDate(this)) from.datepicker("option", "maxDate", getDate(this))
}) })
$('#filters').dialog({autoOpen: false, modal: true, height: 'auto', width: $(window).width() - 200})
$('#btn-open-filter').click(function() {
$('#filters').dialog('open')
})
viewMap() viewMap()
}) })

View file

@ -11,9 +11,12 @@
{% block content %} {% block content %}
<style> <style>
.ui-datepicker { z-index: 10 !important ;} .ui-datepicker { z-index: 200 !important ;}
</style> </style>
<div id="dialog"></div> <div id="dialog"></div>
<div id="short-actions">
<button class="btn" id="btn-open-filter">Filtra</button>
</div>
<div id="filters"> <div id="filters">
<!-- TODO: rendi collassabile --> <!-- TODO: rendi collassabile -->
<header><h3>Filtra</h3></header> <header><h3>Filtra</h3></header>
@ -22,9 +25,17 @@
<div class="form-field-line"> <div class="form-field-line">
<label for="tipo_radio__id">Osservazione fatta con</label> <label for="tipo_radio__id">Osservazione fatta con</label>
<select name="tipo_radio__id" > <select name="tipo_radio__id" >
<option value="NA" disabled selected="selected">//</option> <option value=""
{% if params.tipo_radio__id == "" %} selected="selected" {% endif %}
>//</option>
{% for tr in tipiradio %} {% for tr in tipiradio %}
<option value="{{tr.id}}"><strong>{{tr.nome}}</strong> - {{tr.descrizione|default:'' }}</option> <option value="{{tr.id}}"
{% if tr.id == params.tipo_radio__id|add:"0" %}
selected="selected"
{% endif %}
>
<strong>{{tr.nome}}</strong> - {{tr.descrizione|default:'' }}
</option>
{% endfor %} {% endfor %}
</select> </select>
<div> <div>
@ -36,7 +47,7 @@
</div> </div>
<button id="search">Filtra</button> <button class="btn" id="search">Filtra</button>
</form> </form>
</div> </div>