Skip to content

Commit

Permalink
Fixed issue #09216: CPDB paging doesn't seem to be working properly
Browse files Browse the repository at this point in the history
Dev: Initially set datatype to local for pagination
Dev: Reset datatype to JSON on edit or add
  • Loading branch information
tpartner committed Sep 6, 2014
1 parent a1fd88b commit d3fab90
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/admin/participantdisplay.js
Expand Up @@ -116,7 +116,7 @@ $(document).ready(function() {
viewrecords : true,
rowList: [25,50,100,250,500,1000,2500,5000],
multiselect: true,
loadonce : false,
loadonce : true,

This comment has been minimized.

Copy link
@c-schmitz

c-schmitz Sep 9, 2014

Contributor

@tpartner It does not work properly with loadonce: true . I can never page more than 25/50 responses. I reverted this in 716670e
Can you explain why you thought this is necessary?

This comment has been minimized.

Copy link
@tpartner

tpartner via email Sep 9, 2014

Author Collaborator

This comment has been minimized.

Copy link
@c-schmitz

c-schmitz Sep 9, 2014

Contributor

I think you were under the impression that it worked (due to that $limit variable bug). But it never did with more than 50 responses . Returning all data from the server is a bad idea because if there are a million participants you don't want them returned all at once ;). Anyway, just though there might be a GUI editing reason for the lines below.

loadComplete : function() {
/* Sneaky way of adding custom icons to jqGrid pager buttons */
$("#pager").find(".ui-share-icon")
Expand Down Expand Up @@ -605,7 +605,12 @@ $(document).ready(function() {
$.extend(jQuery.jgrid.edit,{
closeAfterAdd: true,
reloadAfterSubmit: true,
closeOnEspace:true
closeOnEspace:true,
beforeSubmit: function () {
// reset the datatype to JSON (loadonce:true sets it to local)
$(this).jqGrid("setGridParam", {datatype: "json"});
return [true,"",""];
}
});

//script for sharing of participants
Expand Down

0 comments on commit d3fab90

Please sign in to comment.