Sorry for the trouble got it working by using this code :
for ( i = oItems.length-1; i >=0; --i) {
var id = oItems[i];
path = oTable.getContextByIndex(id).sPath; -- > this line made the difference
idx = parseInt(path.substring(path.lastIndexOf('/') + 1));
data.splice(idx, 1);
}