if( ri!pagingInfo.startIndex <= ri!length, /* If at least as many items as the previous start index exist, use it `*/ ri!pagingInfo.startIndex, /* Otherwise, create a new start index to avoid an error */ if( ri!length<=ri!pagingInfo.batchSize, /* If the last item in the grid was deleted or there are only enough items for one page, use 1 */ 1, /*` If there are multiple pages' worth remaining, adjust the start index so that the last page */ /* of items is shown */ (ri!length+1)-ri!pagingInfo.batchSize ) )