Order: network list is now sorted

This commit is contained in:
Frank Schubert
2021-11-30 22:12:34 +01:00
parent 6fa6dbbd87
commit ce138eb64f
2 changed files with 14 additions and 2 deletions

View File

@@ -29,7 +29,6 @@
<div class="col-1">
<label class="form-label" for="filter_network_id">Netzgebiet</label>
<select name="filter[network_id]" id="filter_network_id" class="form-control">
<option></option>
<?php foreach($mynetworks as $fnet): ?>
<option value="<?=$fnet->id?>" <?=($filter['network_id'] == $fnet->id) ? "selected='selected'" : ""?>><?=$fnet->name?></option>
<?php endforeach; ?>
@@ -978,6 +977,19 @@
});
});
$('#filter_network_id').select2({sorter: function(data) {
return data.sort(function (a, b) {
if (a.text > b.text) {
return 1;
}
if (a.text < b.text) {
return -1;
}
return 0;
});
}
});
var order;
var hash = window.location.hash.substr(1);
var match = hash.match(/order=(\d+)/);