Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 onPaging 事件并对其进行一些后端逻辑并将json发送回jsp页面。例如,我的网格中有 10 条记录,rownum 是 2。这意味着我有 5 页要显示。单击下一步按钮编号。显示的页面数已更改 (2/5),但数据仅显示前 2 条记录。
我在 json 对象字符串中得到“页面”:
{"page":2,"records":9,"rowNum":2,...}
但是第 2 页上显示的记录与第 1 页上的记录相同。
如果 jqGrid 将要求服务器获取第二页,您应该在 JSON 数据中仅包含两行:序号为 3 和 4 的记录:
{ "total": 5, "page": "2", "records": "10", "rows": [ { "id": "id of the record 3", "cell": [...] }, { "id": "id of the record 4", "cell": [...] } ] }
如果您使用其他数据格式,您仍然应该在服务器响应中仅包含有关第二页的信息。