Value of sortInfo not updating

We were trying to use external sorting, but gridOptions.sortInfo was not getting updated with selected column, field and direction when the column header was clicked.

The reason we believe sortInfo was not getting updated was because in the grid class self.config.sortInfo was getting set to a new sortInfo object in the sortData function, but gridOptions.sortInfo was still referencing the original sortInfo object.  So in our controller that was watching gridOptions.sortInfo the value of sortInfo was unchanged.  Our fix updates the values of the original sortInfo object if sortInfo is set, otherwise it will create a new sortInfo object.