Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Pagination of filtered results 02 Dec 2013 11:02 #11720

Hi,

I have completed my component three months ago, and now I am doing some refinement :) I have a question/issue about pagination

Inside adminitstration, collection view, is there a way to change the pagination from default_grid.php ?

I have created a custom filter that collects a parent-id.
The parent-id is read inside default_grid.php and, out of the whole elements list, only the elements that descends from the parent-id element are shown. This works nicely but then I have a problem with the pagination, this is the scenario:

1) Normally I see my full elements list and I have a pagination with a (global) limit of 100 results, that results in a pagination of 5 pages.
2) Then I set my filter. Let's assume that the block of children of my selected parent-id is all inside page 2.
3) When I set my select, the id is sent correctly, and the elements are filtered BUT the pagination does not change its structure: page 1 becomes empty, page 2 shows the correctly filtered results, pages 3 to 5 are empty -> not a very nice result.

It seems to me that setting list.start and list.limit inside default_grid.php, when the list is filtered, does not affect the pagination. If I echo the new set values for list.limit and list.start these have the updated values, but they do not affect the jmodel.list paginated structure.

The filtering process is really simple: the parent-id is retrieved inside default_grid.php, a function computes the list of descendant items, and when rendering the resuts:
<?php
	$k = 0;

	for ($i=0, $n=count( $this->items ); $i < $n; $i++):

		$row = &$this->items[$i];
			if (in_array($row->id, $view_tree)){
................................. // <tr><td> that populate the table of results
}
		?>

Is there a way I can solve this without having to code again the whole filter?

Elena

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.055 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started