Ticket #2529975 (closed defect)
Reporter Alberto Santini |
Opened: 02/18/11 Last modified: 06/28/11 Status: closed Type: defect Resolution: duplicate Duplicate of: #2529872 |
Owner Luke Smith |
Target Release: 3.4.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | DataSource and DataTableSort recordset.sort is undefined | ||
| Description: | In datatable-sort.js -> _onEventSortColumn -> dt.get("recordset").sort.sort(field, dir === DESC, sorter) it is displayed the following error: dt.get("recordset").sort is undefined |
||
| 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: | N/A | ||
| URL: | |||
| Test Information: |
|
||
Change History
|
Posted: 02/18/11
|
|
Posted: 02/18/11
Workaround:
|
|
Posted: 02/18/11
|
|
Posted: 02/19/11
This issue also occurs without using a DataSource when setting the datatable's recordset property if the base Y.RecordSet is used. A workaround that I use is as follows:
This is a kind of "multi-inheritance" problem and I can see how it would come up quite often with any plugin that modifies RecordSet. One suggestion would be to have the DataTable itself have a reference to a RecordSet constructor and then have plugins register new constructors as added. Then we can create new RecordSets of the appropriate type by using the DT field: Would have to chain constructor calls so not sure what issues that would raise. |
|
Posted: 03/3/11
|
|
Posted: 03/3/11
Yeah, onDataReturnInitializeTable is creating a new RecordSet, which does not inherit the plugins assigned to its predecessor. Same goes for any invocation of table.set('recordset', new Y.RecordSet(...)); |
|
Posted: 06/28/11
This ticket was marked as a duplicate of #2529872 |
|
Posted: 06/28/11
A possibly simpler workaround: <code> |
|
Posted: 06/28/11
nelson_menezes, |
It seems the recordset is correctly initialized in "initializer" method of datatable-scroll:
dt.get("recordset").plug(Y.Plugin.RecordsetSort, {dt: dt});
Then in _onEventSortColumn method it seems the recordset is another one and it has not "sort" property.
dt.get("recordset").sort.sort(field, dir === DESC, sorter);
(dt.get("recordset").sort --> undefined)
Maybe DataTableDataSource plugin overwrites the recordset in onDataReturnInitializeTable method.