10446 Posts in 2223 Topics by 1719 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1682 Views |
-
event calendar with pagination?

26 April 2009 at 10:23pm
hi,
how can i enable pagination for the calendar?
thanks
-
Re: event calendar with pagination?

28 April 2009 at 1:16am
It's not supported yet, but assuming you have your own Calendar subclass, you can just overload the Events() method.
public function Events( args... )
{
$events = parent::Events(args.. );
$per_page = 10;
if(!isset($_REQUEST['start'])) $_REQUEST['start'] = 0;
return $events->getRange($_REQUEST['start'], $per_page);
} -
Re: event calendar with pagination?

28 April 2009 at 5:06am
hi unclecheese,
thanks a lot, you're very helpful!
-
Re: event calendar with pagination?

2 May 2009 at 4:01am
can i use
setPageLimits() or setPageLength()
on the $events in the overloading Events()?
because when i tried
public function Events( )
{
$events = parent::Events( );
$per_page = 10;
if(!isset($_REQUEST['start'])) $_REQUEST['start'] = 0;
$events->setPageLimits($_REQUEST['start'], $per_page, $events->Count());
return $events;
}i got the right paging info, but all of the events at once. when using getRange(), i got the correct number of events, but no paging info...
thanks
-
Re: event calendar with pagination?

12 March 2010 at 3:45am
Hi there
does anybody got correct pagination of dataobjectset with "setPageLimits"? At the moment I have exactly the same problem like "marcink".
Any help please!
Best regards
Digital Punk -
Re: event calendar with pagination?

21 September 2010 at 9:41am Last edited: 21 September 2010 9:42am
You need to use both getRange and setPageLimits. Just make sure to use setPageLimits after getRange because getRange returns a new dataobjectset.
public function Events($filter = null, $start_date = null, $end_date = null, $default_view = false, $limit = null, $announcement_filter = null) {
$events = parent::Events($filter, $start_date, $end_date, $default_view, $limit, $announcement_filter);
$perPage = 20;
if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1) $_GET['start'] = 0;
$start = (int) $_GET['start'];
$totalSize = $events->Count();
$limitedEvents = $events->getRange($start, $perPage);
$limitedEvents->setPageLimits($start, $perPage, $totalSize);
return $limitedEvents;
}
| 1682 Views | ||
|
Page:
1
|
Go to Top |


