[Minor] sort reports

This commit is contained in:
Robert von Burg 2018-10-29 18:19:21 +01:00
parent 2f0716e6ce
commit 6902da6796
2 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{
"name": "strolch-wc-reports",
"description": "Strolch WebComponent Reports",
"version": "0.1.3",
"version": "0.1.4",
"authors": [
"Robert von Burg"
],

View File

@ -365,10 +365,20 @@
},
onGetReportResponse: function (event) {
// get the response
var response = event.detail.response;
var data = event.detail.response.data;
var that = this;
data.sort(function (a, b) {
a = that.localize(a.name);
b = that.localize(b.name);
if (a < b)
return -1;
if (a > b)
return 1;
return 0;
});
// directly set this as the available types
this.set("reports", response.data);
this.set("reports", data);
},
onGetFacetResponse: function (event) {
// get the response