angular-ui/ng-grid — pull request #641 by rubenv (2013-08-20 11:05:17+00:00)
Title: Adjust setSelection to use primaryKey.

Provides a fix for #580, which is a bug in toggling selections while
paging through data.

Before this patch, getSelection had support for using
grid.config.primaryKey. The setSelection operation on the other hand did
not, which caused this subtle bug.

This commit introduces a getSelectionIndex method that pulls the logic
for using grid.config.primaryKey out of getSelection and adjusts
setSelection to use getSelectionIndex.