I have a flat list of objects that I am grouping for a dropdown list. The issue is that no matter what, the order of the groups is always in descending order, even if I provide the "dir" sort descriptor. Please see the following code
//Group departments by user departments and other for easier access on UI
this.departments.forEach(department => {
department["subCategory"] = this.isMyDept(department.id) ? "My Departments": "Others";
});
this.departmentGrouping = groupBy(this.departments, [
{ field: "subCategory", dir: "asc" },
]) as GroupResult[];
<kendo-dropdownlist
[(ngModel)]="deptID"
[data]="departmentGrouping"
[filterable]="true"
[showStickyHeader]="false"
textField="name"
valueField="id"
[valuePrimitive]="true"
>
</kendo-dropdownlist>
When my dropdown is displayed, the "Others" group is always on top. It doesn't matter if I change the "dir" descriptor to "asc" or "desc" in the groupBy function, nothing changes. How do I sort the group order so I can have "My Departments" as the top group?