You can learn sort state in the grid via the getSortingState method.