Page 1 of 1

[SOLVED] Pagination in J!1.5

Posted: Fri Feb 22, 2008 9:21 pm
by macbloke
Hi,

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 );
And the query in the fashion:

Code: Select all

$db->setQuery( $query, $pageNav->limitstart, $pageNav->limit );
But if the model code is:

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;
	}
I can't see how I can get this to work.

Any ideas?

Thanks,

StuG

Re: Pagination in J!1.5

Posted: Sat Feb 23, 2008 1:13 am
by radiant_tech
Stu,

This Jpagination page in the Documentation Wiki that I've been working on should help.

Re: Pagination in J!1.5

Posted: Sat Feb 23, 2008 9:13 am
by macbloke
Bargain!

TVM,

StuG