From 5e17e0defd6cab9f4a45faf96a1f875267baafb6 Mon Sep 17 00:00:00 2001 From: zmsdev Date: Tue, 10 Oct 2023 20:52:45 +0200 Subject: [PATCH] pageCount --- Products/zms/zpt/ZMSRecordSet/main_grid.zpt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);">