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

The j-cook project is one of the best of its kind and it is nice that we all try to contribute in little ways to make life easy for each other.

vlemos (Forum)  

Get Started