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 #9992

orderBy=0 is lost in _parseHttpRequest()

Details

Submitted2007-01-31 19:27 UTC
Frommichael dot mauch at gmx dot de
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2007-01-31 19:27 UTC] michael dot mauch at gmx dot de

Description:
------------
Hi,

with DATAGRID_SOURCE_ARRAY, I can't sort for the first (zeroth) column, because orderBy=0 and _parseHttpRequest() has a line

if ($orderBy = $this->_getRequestArgument('orderBy')) {

instead of

if (($orderBy = $this->_getRequestArgument('orderBy')) !== null) {

Regards...
Michael

Test script:
---------------
<?php
require 'Structures/DataGrid.php';
$values = array(array("A1","Bx1","C1",),
array("A2","Bc2","C2",),
array("A3","Bz3","C3",),
);
$datagrid =& new Structures_DataGrid();
$test = $datagrid->bind($values, null, DATAGRID_SOURCE_ARRAY);
if (PEAR::isError($test)) {
echo $test->getMessage();
}
$test = $datagrid->render();
if (PEAR::isError($test)) {
echo $test->getMessage();
}
?>

Expected result:
----------------
The sort links should work for all columns.

Actual result:
--------------
Column 0 cannot be sorted.