PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Structures » Structures_DataGrid » Bug #6450

sortRecordSet does not work if called after bind

Details

Submitted2006-01-09 21:07 UTC
Fromdsouzae at hotmail dot com
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid
PHP Version5.1.1
Roadmaps(Not assigned)

Comments

[2006-01-09 21:07 UTC] dsouzae at hotmail dot com

Description:
------------
Documentation examples and method description shows sortRecordSet being called after bind instead of before. This is especially noticeable if direction is "DESC" by default and are using a database backend (via DataObject).

bind automatically calls fetchDataSource which does the database queries.

Works fine after clicking a few times of the column for sorting because the Core class automatically scans the request for the required sorting order before the bind method has been called.

[2006-01-10 23:40 UTC] dsouzae at hotmail dot com

Thanks for the quick documentation update (I spent a day trying to figure out why it didn't work).

The document example for sortRecordSet is done after the bind (mention in comment of example):

http://pear.php.net/manual/en/package.structures.structures_datagrid.structures_datagrid.sortrecordset.php:
$dg =& new Structures_DataGrid();

// ... get my data and bind it to the $dg ...

$dg->sortRecordSet('lname', 'ASC');

$dg->render();