--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
protected function _getList($query, $limitstart=0, $limit=0)
2011/11/4 Phill Brown <pbr...@softwaresolutions.com.au>:
--
С Уважением,
Романов Р. В.
+7 (917) 256-61-03
mailto:rrv....@gmail.com
Alfred
-----Oorspronkelijk bericht-----
Van: joomla-de...@googlegroups.com
[mailto:joomla-de...@googlegroups.com] Namens Ron W
Verzonden: donderdag 3 november 2011 20:52
Aan: Joomla! General Development
Onderwerp: [jgen] JModelList::getListQuery - How to set limit and offset for
query
Thanks,
Ron
--
This in turn calls the JDatabase setQuery() method, that takes the
same 3 args. The limitstart and limit values are set in the
populateState method in the model, based on which "page" the user is
in.
Hope that helps. Mark
I got it working by adding a populateState method, but apparently I don't
get the big picture, I always associated limit and limitstart with the
pagination in the backend.
So am I making a fundamental mistake here by using it frontside?
I need a list of items in my frontend form, for this I have a query that
needs to return all items, not just the standard 20...
I now have in my site model:
protected function getListQuery()
{
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('id,name,email,prefix,extra,extra2,defsubject,published,acces
s');
$query->from('#__alfcontact');
$query->where('published > 0');
$query->where('access IN ('.$groups.')');
$query->order('`ordering` ASC');
return $query;
}
protected function populateState()
{
$this->setState('list.limit', 150);
}
It now returns all items (as long as its under 150), but is this the wrong
approach ?
Alfred
-----Oorspronkelijk bericht-----
Van: joomla-de...@googlegroups.com
[mailto:joomla-de...@googlegroups.com] Namens Mark Dexter
Verzonden: zaterdag 24 december 2011 16:57
Aan: joomla-de...@googlegroups.com
Onderwerp: Re: [jgen] JModelList::getListQuery - How to set limit and offset