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.087 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started