开发者

on jqgrid next button click, data is not being populated

I am using onPaging event and doing some back-end logic on it and sending json back to jsp page. e.g. I have 10 records in my grid, and rownum is 2. that means i have 5 pages to display. on click of next button no. of pages displayed is changed (2/5) but data shows first 2 records only.

开发者_Python百科I am getting "page" in json object string:

{"page":2,"records":9,"rowNum":2,...}

but the records visible on page 2 are same as it was on page 1.


If jqGrid will ask the server to get the second page you should include in the JSON data only two rows: the records with the ordinal numbers 3 and 4:

{
    "total": 5,
    "page": "2",
    "records": "10",
    "rows": [
        { "id": "id of the record 3", "cell": [...] },
        { "id": "id of the record 4", "cell": [...] }
    ]
}

If you use another data format you should nevertheless include only information about the second page in the server response.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜