[SOLVED] Pagination in J!1.5
Posted: Fri Feb 22, 2008 9:21 pm
Hi,
Using the MVC methodology, how do you get the pagination to work?
I want to use JPagination as per:
And the query in the fashion:
But if the model code is:
I can't see how I can get this to work.
Any ideas?
Thanks,
StuG
Using the MVC methodology, how do you get the pagination to work?
I want to use JPagination as per:
Code: Select all
jimport('joomla.html.pagination');
$pageNav = new JPagination( $total, $limitstart, $limit );
Code: Select all
$db->setQuery( $query, $pageNav->limitstart, $pageNav->limit );
Code: Select all
function _buildQuery()
{
$query = ' SELECT * FROM #__gphmgrgraphs ORDER BY graphID ASC, graphRowID ASC';
return $query;
}
function getData()
{
// Lets load the data if it doesn't already exist
if (empty( $this->_data ))
{
$query = $this->_buildQuery();
$this->_data = $this->_getList( $query );
}
return $this->_data;
}
Any ideas?
Thanks,
StuG