I had this problem. If you look carefully in the ui0grid.js code, you will see that at the moment there is no possibility of forwarding it. The ui-grid authors claim that they would welcome a request for such a function to this thread
, ; -)
, sortColumns sortChanged.
- :
$scope.gridOptions.onRegisterApi = function(gridApi) {
$scope.gridApi = gridApi;
$scope.gridApi.core.on.sortChanged($scope, function(grid, sortColumns) {
if (sortColumns.length > 1) {
var column = null;
for (var j = 0; j < grid.columns.length; j++) {
if (grid.columns[j].name === sortColumns[0].field) {
column = grid.columns[j];
break;
}
}
if (column) {
sortColumns[1].sort.priority = 1;
column.unsort();
}
}
});
};
ui-grid 3.0.0.