I am facing an issue with enabling disabled sorting in ui-grid in Angular 1. I have attempted to do this in the grid columnsDefs:
{
...
enableSorting: false
},
Furthermore, I have tried to override it when a certain event occurs in my controller:
$scope.$watch("vm.verifiedCreatedRecords", function(newVal, oldVal){
if(newVal.length > 0){
vm.UpdateCreationGridOptions.columnDefs[4].enableSorting = true;
}
else {
vm.sortingCreate = false;
}
}, true);
Even though
vm.UpdateCreationGridOptions.columnDefs[4].enableSorting
is set to true, the grid still does not allow sorting and remains in its default state for sorting.
Additionally, I have configured the general option as "useExternalSorting: true".
If anyone has any suggestions on how to refresh the ui-grid, your help would be greatly appreciated. Thank you!