I am trying to define an initial sort.
as far as the request, the sort is working and the data comes sorted.
the problem is that in the header, the visual arrow of sort column and direction is not shown.
only after physical click on the column it shows.
please help, this is the used code:
$scope.mainGridOptions = {
dataSource: {
sort: { field:
"email"
, dir:
"desc"
},
serverPaging:
true
,
serverSorting:
true
,
pageSize: 50,
transport: {
read: {
type:
"GET"
,
dataType:
"json"
,
url:
"/p/enduser/licenses/allocation/listWithDevices"
,
headers: {
"X-AUTH-TOKEN"
: authService.getToken()
}
},
parameterMap:
function
(data, type) {
if
(type ==
"read"
) {
console.log(data);
return
{
pageSize: data.take,
page: (data.skip/data.take),
sortBy: data.sort?data.sort[0].field:
null
,
sortDir: data.sort?data.sort[0].dir:
null
}
}
}
},
schema: { data:
"items"
, total:
"itemsCount"
}
},
height: $scope.resize(),
scrollable: {
virtual:
true
},
sortable: {
allowUnsort:
false
,
mode:
'single'
}
};