I'm trying to implement a client side function to allow a user to re-focus the scheduler on today's date.
Here's my code:
function ScrollToToday() {
var dp = new DayPilot.Scheduler("<%= DayPilotScheduler1.ClientID%>");
dp.scrollTo("2015-09-11");
}
demo.aspx (code that shows the scheduler)
<DayPilot:DayPilotScheduler ID="DayPilotScheduler1" runat="server" DataStartField="eventstart" DataEndField="eventend" DataTextField="name" DataValueField="id"
DataResourceField="resource_id"
CellGroupBy="Month"
CellDuration="1440"
StartDate="2009-01-01"
Days="365"
Width="100%"
EventHeight="25"
Height="450px"
HeightSpec="Max"
Theme="scheduler_8"
RowHeaderWidth="120">
</DayPilot:DayPilotScheduler>
I also have an input button that calls the function. When I execute, I get a JavaScript error:
"JavaScript runtime error: Unable to get property 'clientWidth' of undefined or null reference"
Can anyone tell me what I'm doing wrong?