Marc Romero
Marc Romero

Reputation: 115

JQGrid virtual scrolling not working

I have a simple JQGrid with this code:

jQuery("#MyJQGrid").jqGrid({
        url: dataUrl,
        datatype: "json",
        height: 550,
        width: 1180,
        colNames: columnNames,
        colModel: columnModel,            
        rowNum: 100,
        mtype: "POST",
        gridview: true,
        sortname: "Times",
        viewrecords: true                       
    });

My JQGrid loads correctly the first 100 rows but it is not loading any more pages. I read and copied the JQGrid page example one time and another and I cannot solve this issue. Can anyone help me, please?

Upvotes: 0

Views: 1134

Answers (2)

Sunil
Sunil

Reputation: 1

url: dataUrl,
loadonce:false,
scroll:true,
mtypge:GET,
datatype: "json",
height: 550,
width: 1180,
colNames: columnNames,
colModel: columnModel,            
rowNum: 100,
mtype: "POST",
gridview: false,
viewrecords: true      

Upvotes: -1

hamed
hamed

Reputation: 8043

If you want to have more data, you should enable paging or scrolling. You can use paging by adding pager: "#pager" in the grid options and add <div id="pager"></div> below your table tag. And if you like to have automatic scrolling, just add scroll: true in your code. Remember, if you set scroll: true, paging will disable automatically. Obviously, you need to handle paging in your server side by adding offset and limit to your sql query in both cases.

Upvotes: 0

Related Questions