search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to get the previous and next linkbuttons

Asked by Anonymous
12 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
12 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');">&#x25c4;</a>
<a href="javascript:dps1.commandCallBack('next');">&#x25ba;</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 months old and has been closed. Please create a new question if you have anything to add.