开发者

Pager information not showing up in jqGrid

This is a fairly embarrassing question. I have jQuery populating my jqGrid. But I can't seem to get it to populate the pager part. Here is a sample JSON response:

{"ROWS":[["",XXX,"XYZ","XYZ","",""],"PAGE":1.0,"RECORDS":2421,"TOTAL":243.0}

And here is the HTML

<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager" class="scroll" style="text-align:center;"></div>

Finally, some of the JS

            pager: '#pager',
              jsonReader: {
                root: "ROWS", 
                page: "PAGE", 
                total: "TOTAL", 
      开发者_如何学C          records:"RECORDS", 
                cell: "", 
                id: "0" 
                }

I feel like I am doing something very simple, but simply wrong. Another set of eyes on this would be appreciated. Thanks!


I suppose that use use loadonce:true option. It follow that after the data are loaded the datatype:'local' will be set. The values from the pager will be used in the case corresponds to the local data.


You know what, I made the mistake of overriding the JSON variables earlier in the query. My advice is take out all extraneous stuff and you will be surprised at how much the grid does for you. Then hack it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜