[SOLVED] Pagination in J!1.5

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
macbloke
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Feb 21, 2008 10:23 am

[SOLVED] Pagination in J!1.5

Post by macbloke » 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:

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
Last edited by macbloke on Sat Feb 23, 2008 10:02 pm, edited 1 time in total.

radiant_tech
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Sat Dec 15, 2007 3:02 pm
Location: Washington DC Metro

Re: Pagination in J!1.5

Post by radiant_tech » Sat Feb 23, 2008 1:13 am

Stu,

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

macbloke
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Feb 21, 2008 10:23 am

Re: Pagination in J!1.5

Post by macbloke » Sat Feb 23, 2008 9:13 am

Bargain!

TVM,

StuG


Post Reply