How to get the previous and next linkbuttons
Asked by Anonymous
15 years ago.
Hi,
I am using the DayPilot Scheduler. Can you please let me know how to have next and previous linkbuttons(month or week).
Is there a setting for that...or do we need to code it out ourselves?
Thanks.
Answer posted by Dan Letecky
15 years ago.
There are no built-in buttons at this moment, but it's easy to add them. See an example from Scheduler/Default.aspx:
<a href="javascript:dps1.commandCallBack('previous');">◄</a>
<a href="javascript:dps1.commandCallBack('next');">►</a>
This link invokes Command event on the server side where you need to change the StartDate, rebind the events and call Update():
protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
{
switch (e.Command)
{
case "next":
DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(1);
DayPilotScheduler1.Days = Year.Days(DayPilotScheduler1.StartDate.Year);
break;
case "previous":
DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(-1);
DayPilotScheduler1.Days = Year.Days(DayPilotScheduler1.StartDate.Year);
break;
}setDataSourceAndBind();
DayPilotScheduler1.Update();
}
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.