I have the following settings for my ng-grid in my code :
$scope.gridOptions = {
...
useExternalSorting : false,
}
$scope.watch('gridOptions.ngGrid.config.sortInfo', function (oldValue, newValue) {
console.log(newValue)
})
I also tried using sortInfo : undefined
and $watch(gridOptions.sortInfo)
. This seems to work only when the grid initially loads. After that, when I click on the header columns, it does not seems to go inside the callback function for the $watch
. I tried putting a debugger inside the callback function which triggers the sort, and I could see the the code updating the sortInfo array with the right information, however it does not seem to go inside the callback function for the watch statement. Is there anything incorrect with my setup? I have a Plunker here with something similar to what I'm trying to do.