21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 384 Views |
-
Using PaginatedList in SS3 [SOLVED]

11 September 2012 at 8:17am
Hi there,
I have a class called PostalCodes that stores all the postal codes details.
In the PostalCodes.php file i have set up the PaginatedList function so that my .ss template displays the list of postal codes with pagination included. This is working well and currently looks like this:
public function PaginatedPages() {
return new PaginatedList(PostalCodes::get(), $this->request );
}What i need to do is customise the function so that it displays 30 records at a time and not the default 10.
From the API documentation i gathered that i must put the method in an array like this:public function PaginatedPages() {
$request = array(
'getPageLength ' => '30',
);
return new PaginatedList(PostalCodes::get(), $this->request );
}It is not working. Any help would be great
Thanks
-
Re: Using PaginatedList in SS3 [SOLVED]

10 October 2012 at 5:04am
Hi, I don't know how you solved this, but I think this should work :
public function PaginatedPages() {
$paginatedList = new PaginatedList(PostalCodes::get(), $this->request );
$paginatedList->setPageLength(50);
return $paginatedList;
}
| 384 Views | ||
|
Page:
1
|
Go to Top |


