diff --git a/Products/zms/zpt/ZMSRecordSet/main_grid.zpt b/Products/zms/zpt/ZMSRecordSet/main_grid.zpt index 31ad505d3..4fcf3a149 100644 --- a/Products/zms/zpt/ZMSRecordSet/main_grid.zpt +++ b/Products/zms/zpt/ZMSRecordSet/main_grid.zpt @@ -15,8 +15,9 @@ size python:options.get('size',len(filtered_records)); total python:options.get('total',len(records)); pageSize python:request.get('qsize',20); - pageIndex python:request.get('pageIndex',int(request.get('qindex',0))//pageSize); - pageIndex python:pageIndex if pageIndex >= 0 else 0; + pageCount python:size//pageSize; + pageIndex python:request.get('pageIndex',int(request.get('qindex',-1))//pageSize); + pageIndex python:pageIndex if pageIndex >= 0 and pageIndex < pageSize else 0; pageStart python:pageIndex*pageSize; pageEnd python:min(pageStart+pageSize,size); offset python:options.get('offset',pageStart);">