Update selectionProvider.js

Usage of $.grep was incorrect and causing loss of selection and expanded state on data update