Hey rstewart,
How are you rendering your links to sort the data? Are you putting this directly
into the view, or are you using Zend_View_Helper_Url ?
( Accessible in the view by $this->url() )
Is this code in your module's controller, or model?
A slightly off-topic tip:
- When using htmlEntities() <http://php.net/htmlEntities>, it's best to also
specify the quote type to ensure quotes and other special characters are
properly escaped before outputting to the browser. In addition, it's also a good
idea to include the character set as the third argument to make sure your data
is escaped using the appropriate character set.
Hope this helps,
-Kizano
//-----
Information Security
eMail: [email protected]
http://www.markizano.net/
On 12/28/2010 06:06 PM, rstewart wrote:
Checked this already.
This is output from getpart. Sort works on first page only even though
getpart output says differently.
Array ( [0] => Array ( [0] => PHPOID [1] => DESC ) )
$select = $db->select()
->from (array ('p' => 'PMPPH' ),
array ('PHPTYP' => 'p.PHPTYP', 'PHPCO' => 'p.PHPCO', 'PHPOID' =>
'p.PHPOID', 'PHPDSC' => 'p.PHPDSC' ))
->where('PHPOID like ?', $pofltrx)
->where('translate(PHPDSC) like ?', $descfltrx)
->where('PHPTYP like ?', $typeselectx)
->where ('PHPCO like ?', $compselectx)
->order ("$sortField $sortDir");
// Create pager object
$pager = new Zend_Paginator (
new Zend_Paginator_Adapter_DbSelect ($select ));
print_r($select->getPart( Zend_Db_Select::ORDER));
// Set current page
$currentPage = isset ( $_GET ['p'] ) ? ( int ) htmlentities ( $_GET
['p'] )
: 1;
$pager->setCurrentPageNumber ( $currentPage );
// Number to dispaly on page
$itemsPerPage = isset ( $_GET ['c'] ) ? ( int ) htmlentities ( $_GET
['c']
) : 14;
$pager->setItemCountPerPage ( $itemsPerPage );
// Pages in page range
$pager->setPageRange ( 5 );
// Get data
$pages = $pager->getPages ( 'Sliding' );