Fixed sort to work properly. Previously did not always sort correctly in IE/Edge. (#494)

This commit is contained in:
Jeff Burt 2018-04-27 10:27:26 -05:00 committed by Vesa Juvonen
parent 3499fe91cc
commit cfa111bbad
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ export class CamlQueryHelper {
// Generates the <Where /> part
if(querySettings.filters && !isEmpty(querySettings.filters)) {
let sortedFilters = querySettings.filters.sort((a, b) => { if(a.index > b.index) { return 1; } else { return 0; } });
let sortedFilters = querySettings.filters.sort((a, b) => { return a.index - b.index; });
query += Text.format('<Where>{0}</Where>', this.generateFilters(sortedFilters));
}