YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub

YUI 2.x

Ticket #2528654 (assigned defect)

Reporter


Satyam
Opened: 11/25/09
Last modified: 04/1/10
Status: assigned
Type: defect

Owner


Jenny Han Donnelly
Target Release: 2.NEXT
Priority: P3 (normal)
Summary: Going to last page fails if number of records on server has dropped
Description:

Steps to reproduce:

- Load a server-side paginated DataTable.
- In the server, delete a couple of pages worth of records from the database server-
- In the client, go to the last page.

DataTable will fail because it requests a page that no longer exists.

Fix:

- In method onDataReturnSetRows, method _handleDataReturnPayload should be called before calculating variable index so the records can be placed wherever the server says, whatever it was able to
deliver

- The example should show how to set the recordOffset in method handleDataReturnPayload from the metadata sent by the server.

The server should send as metadata the startIndex requested or, if it cannot deliver those, send the startIndex of whatever information it was able to send. It is to be assumed that the server will
try to send the set of records closest to the ones requested. The DataTable will then go to the page were those records can be seen.

Type: defect Observed in Version: 2.8.0
Component: DataTable Severity: S3 (normal)
Assigned To: Jenny Han Donnelly Target Release: 2.NEXT
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: N/A
URL:
Test Information:

Change History

Satyam

YUI Contributor

Posted: 11/29/09

When the call to method _handleDataReturnPayload is moved up in method onDataReturnSetRows as suggested above, the records have not been transferred from the response object to the recordset by the time it is called, thus, the following line in _handleDataReturnPayload:

oPaginator.set('totalRecords',this._oRecordSet.getLength());

should change to this:

oPaginator.set('totalRecords',oResponse.results.length)

George

YUI Developer

Posted: 12/1/09

Luke Smith

YUI Developer

Posted: 12/1/09
  • milestone changed to 2.NEXT
  • status changed from assigned to accepted

Luke Smith

YUI Developer

Posted: 04/1/10

Jenny, can you triage this? If it's more appropriate for me to address in your opinion, please assign it back to me.