Ticket #2529872 (closed defect)
Reporter Jenny Donnelly |
Opened: 01/26/11 Last modified: 04/16/12 Status: closed Type: defect Resolution: fixed |
Owner Luke Smith |
Target Release: 3.4.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | [bz 4284252] XHR data load breaks sorting | ||
| Description: | Calling load after setting up sorting breaks sorting. |
||
| Type: | defect | Observed in Version: | 3.3.0 |
| Component: | DataTable | Severity: | S3 (normal) |
| Assigned To: | Luke Smith | Target Release: | 3.4.0 |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | All | ||
| URL: | |||
| Test Information: | YUI({ filter: 'raw' }).use("datasource-get", "datasource-jsonschema", "datatable-sort", "datatable-datasource", function (Y) { Y.Plugin.DataTableDataSource.prototype.onDataReturnInitializeTable = function(e) { dt.datasource.load({request:"&q=select%20*%20from%20local.search%20where%20zip%3D%2794089%27%20and%20query%3D%27pizza%27"}); /*dt.on("recordsetChange", function(e){ //dt.get("recordset").sort.addTarget(dt); |
||
Change History
|
Posted: 02/3/11
|
|
Posted: 02/18/11
|
|
Posted: 03/3/11
|
|
Posted: 04/22/11
|
|
Posted: 06/28/11
Ticket #2530184 was marked as a duplicate of this ticket. |
|
Posted: 06/28/11
Ticket #2529975 was marked as a duplicate of this ticket. |
|
Posted: 07/18/11
Replace the Recordset records, not the Recordset Fixes #2529872 onDataReturnInitializeTable was replacing the View Commit: 364b3f41370b5853ec58ed0f094565f69ab7c7fd |
|
Posted: 07/18/11
|
|
Posted: 07/18/11
|
|
Posted: 08/18/11
|
|
Posted: 09/26/11
Ticket #2531191 was marked as a duplicate of this ticket. |
msn [bot]
|
Posted: 04/16/12
|
I've encountered this problem also. The issue is that by default the onDataReturnInitializeTable method of the DataTableDataSource creates a new RecordSet object when loading a new data set, however the DataTableSort plugin is listening on the particular RecordSet instance. Since that's thrown away on a load the sort plugin never notices that there's new data to be sorted. I created a special subclass of DataTableDataSource that fixes this bug. Instead of creating a new RecordSet instance, it empties the old one and adds the new results.
We're all waiting on Luke's new and improved DataTable :)