Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Pagination; data loading from server, but client side doesn't refresh
13/10/2010
00:18
Avatar
coke
Member
Members
Forum Posts: 5
Member Since:
20/08/2010
sp_UserOfflineSmall Offline

I have a jqgrid with a navGrid plugin that is configured to show 10 records at a time, and a server side query that has 42 rows.

When the page first loads, the server generates JSON to show that this is page 1 of 5, 42 records total, and gives the 10 records; These display no problem.

When I use the pagination buttons, these generate an AJAX call to the server asking for the appropriate page. The response contains a new set of 10 records (or 2 for the last page.).

My problem is that the jqGrid doesn't refresh after getting the server response – it continues to show the data that was originally loaded  (page 1). Also, while the buttons are active appropriately (I can click next until I hit the last page and each one generates an AJAX call), the button display doesn't change – the previous button is always shown disabled, for example. (but it works, and generate the appropriate AJAX call.)

Here's some code that shows the issue:

$("#filingGrid").jqGrid({
url: CCF.docroot + "cfcs/grid/filings.cfc?method=getFilingsByEntity&le_id=31902&returnFormat=plain",
  datatype: "json",
  colNames:['Status', 'Filing ID','Frequency', 'Year', 'Period Start','Period End', 'Due Date', 'Filed'],
  colModel:[
    {name:'status', index:'status', formatter: statusFormatter, align: "center" },
    {name:'id', index:'id', classes: "faux-link" },
    {name:'period_description', index:'period_description'},
    {name:'period_year', index:'period_year', width:75},
    {name:'period_start_date', index:'period_start_date', formatter: dateFormatter},
    {name:'period_end_date', index:'period_end_date', formatter: dateFormatter},
    {name:'external_due', index:'external_due', formatter: dateFormatter},
    {name:'external_file', index:'external_file', formatter: dateFormatter}
],
  rowNum: 10,
  pager: "#filingGridPager",
  viewrecords: true
}).jqGrid('navGrid','#filingGridPager', {});

The HTML this is working on is: <div id="filingGridPager"></div><table id="filingGrid"><tr><td></td></tr></table>. I verified I'm loading the locale JS and then the full jqGrid JS (selecting all the various options from the 3.8 download).

Any help is greatly appreciated, thanks.

14/10/2010
00:04
Avatar
coke
Member
Members
Forum Posts: 5
Member Since:
20/08/2010
sp_UserOfflineSmall Offline

There was a bug in the data returned by the server - on every page but the first, there was an initial comma in the list of row data. (server originally returned all data; when it was converted to only return the N rows for the page, this condition was missed.)

It would be nice if invalid data threw some kind of error to make it more obvious where things break down.

With the bugfix in place, the paging/sorting works great.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
63 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information