You haven't shared code of obj.
So based on guess, are you using groupModel?
groupModel.dataIndx, groupModel.groupCols is an array of dataIndx. Error may occur if groupModel.dataIndx values are incorrect, i.e., don't exist in colModel.
Please share a jsfiddle/ plnkr so that I can check it if error still persists.