Detach rows in this context means removal of row objects ( the rows which you don't want to be sorted ) from dataModel.data array in beforeSort event with Array.splice method
and attach rows means re addition of the rows in dataModel.data array in sort event.