I followed some other posts, due to the lack of scheduler data loading examples. I do not get any errors on the page, or from the connector but I get two major issues:
- The next and previous buttons do not load the arrow icons
- Nothing loads in the timeline
Here is the code for the Default.aspx page:
<%@ Page Language="VB" AutoEventWireup="false" Inherits="dhtmlx._Default" Codebehind="Default.aspx.vb" %>
<!DOCTYPE html>
<html>
<head>
<title>Timeline View. dhtmlxScheduler</title>
<script src="Content/dhtmlxscheduler.js" type="text/javascript"></script>
<script src="Content/dhtmlxscheduler_dhx_terrace.js" type="text/javascript"></script>
<script src="Content/dhtmlxscheduler_timeline.js" type="text/javascript"></script>
<script src="Content/connector.js" type="text/javascript"></script>
<link href="Content/dhtmlxscheduler.css" rel="stylesheet" media="screen" type="text/css" />
<style type="text/css" media="screen">
html, body{
margin:0px;
padding:0px;
height:100%;
overflow:hidden;
}
</style>
<script type="text/javascript" charset="utf-8">
function init() {
scheduler.locale.labels.timeline_tab = "Timeline"
scheduler.locale.labels.section_custom = "Section";
scheduler.config.details_on_create = true;
scheduler.config.details_on_dblclick = true;
scheduler.config.xml_date = "%Y-%m-%d %H:%i";
scheduler.config.first_hour = 6
scheduler.config.last_hour = 23
scheduler.createTimelineView({
name: "timeline",
x_unit: "minute",
x_date: "%H:%i",
x_step: 30,
x_size: 24,
x_start: 16,
x_length: 48,
y_unit: scheduler.serverList("sections"),
y_property: "DRIVER_ID",
render: "bar"
});
scheduler.init('scheduler_here', new Date(1900, 0, 1), "timeline");
scheduler.load("DatabaseConnector.ashx");
}
</script>
</head>
<body onload="init();">
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
<div class="dhx_cal_navline">
<div class="dhx_cal_prev_button"> </div>
<div class="dhx_cal_next_button"> </div>
<div class="dhx_cal_today_button"></div>
<div class="dhx_cal_date"></div>
<div class="dhx_cal_tab" name="day_tab" style="right:215px;"></div>
<div class="dhx_cal_tab" name="timeline_tab" style="right:280px;"></div>
</div>
<div class="dhx_cal_header"></div>
<div class="dhx_cal_data"></div>
</div>
</body>
</html>
Here is the connector (handler) code:
Imports System.Web
Imports System.Web.Services
Imports dhtmlxConnectors
Public Class DatabaseConnector
Inherits dhtmlxRequestHandler
Public Overrides Function CreateConnector(ByVal context As HttpContext) As dhtmlxConnectors.IdhtmlxConnector
Dim MyConnector As New dhtmlxSchedulerConnector(
"EVENTS", _
"EVENT_ID", _
dhtmlxDatabaseAdapterType.SqlServer2005, _
ConfigurationManager.ConnectionStrings("ResourceManagement").ConnectionString, _
"START", _
"END", _
"DRIVER_ID, ROUTE" _
)
Dim MyOptions As New dhtmlxOptionsConnector(
"DRIVERS",
"DRIVER_ID",
dhtmlxDatabaseAdapterType.SqlServer2005,
ConfigurationManager.ConnectionStrings("ResourceManagement").ConnectionString, _
"DESCRIPTION"
)
MyConnector.AddOptionsConnector("sections", MyOptions)
Return MyConnector
End Function
End Class
The database contains all the columns listed in to the connectors and the connection string is good (tested using SqlConnection). Does the connection string need to be OLEDB or ODBC to work with the connector? I am using the new 3.7 of the scheduler with the Terrace skin.