Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rowNum parameter is not reflecting #738

Closed
senthilporunan opened this issue Nov 6, 2015 · 2 comments
Closed

rowNum parameter is not reflecting #738

senthilporunan opened this issue Nov 6, 2015 · 2 comments

Comments

@senthilporunan
Copy link

Hi,

I am trying to set pagination with help of jqGrid. So, i have set rowNum as 10 (10 records per page) with the help of below configuration. But, its loading 70 records in same page. And in pagination it is showing Page 1 of 0. Please find the attached image.

$('#gridId').jqGrid({
datatype: "local",
gridView: true,
colNames: ['A','B'],
colModel: [ ...],
rowNum : 10,
loadonce: true ,
pager : '#pageDiv',
loadComplete: function() {
loadGridData();
}
});

var loadGridData = function() {
var data= $.parseJSON('${result}');
for(var i=0;i<=data.length;i++){
$('#gridId').addRowData(i+1, data[i]);
}
}

@tonytomov
Copy link
Owner

Hello,

The addRowData is not a good way to add a records with pagination.
If the result response is a json data you can still set data parameter in grid

$('#gridId').jqGrid({
datatype: "local",
data: result,
gridView: true,
...

Suppose result is JSON.

if the result is a string you can direct use datastr parameter like this

$('#gridId').jqGrid({
datatype: "local",
datastr: result,
gridView: true,
...

Using gridComplete is not needed in this case.

Please let me know if this resolves the problem.

Kind Regards

@tonytomov
Copy link
Owner

In case there is a problem with this, please reopen it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants