Hello Allaksandr,
Thanks for your updates. I was trying to upload data from database and display into the timeline view but I was not able to display.
When I changed the view to month ,data was coming what is the problem in timeline view.
Given below is my jsp page.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<%-- <script type="text/javascript" charset="utf-8" src='<s:url value="./js/dhtmlxscheduler.js"/>'></script> --%>
<script type="text/javascript" charset="utf-8" src="./codebase/dhtmlxscheduler.js"></script>
<link rel="stylesheet" href="./codebase/dhtmlxscheduler.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="./codebase/ext/dhtmlxscheduler_limit.js" type="text/javascript" charset="utf-8"></script>
<%-- <script src="./codebase/ext/dhtmlxscheduler_dhx_terrace.js" type="text/javascript" charset="utf-8"></script> --%>
<script src="./codebase/ext/dhtmlxscheduler_minical.js" type="text/javascript" charset="utf-8"></script>
<script src="./codebase/ext/dhtmlxscheduler_timeline.js" type="text/javascript" charset="utf-8"></script>
<style media="screen">
html, body{
margin:0px;
padding:0px;
height:100%;
overflow:hidden;
}
.dhx_cal_event {
z-index: 1;
cursor: pointer;
}
.highlighted_timespan {
opacity:0.5;
filter:alpha(opacity=50);
cursor: pointer;
z-index: 0;
}
</style>
<script charset="utf-8">
function init() {
scheduler.config.xml_date="%Y-%m-%d %H:%i";
var sections=[
{key:1, label:"Open shift"},
{key:2, label:"James Smith"},
{key:3, label:"John Williams"},
{key:4, label:"David Miller"},
];
scheduler.createTimelineView({
name: "timeline",
x_unit: "minute",
x_date: "%H:%i",
x_step: 30,
x_size: 12,
x_start: 16,
x_length: 48,
y_unit: sections,
y_property: "section_id",
render:"bar"
});
scheduler.init("scheduler_here",new Date(2014,5,30),"timeline");
scheduler.load("myconnector.do?uid="+scheduler.uid());
}
</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 name="day_tab" onclick="tempday();" style="right:204px;"></div>
<div class="" name="week_tab" onclick="tempWeek();"style="right:140px;"></div>
<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div> -->
<div class="dhx_cal_tab" name="timeline_tab" "style="right:76px;"></div>
</div>
<div class="dhx_cal_header">
</div>
<div class="dhx_cal_data">
</div>
</div>
</body>
</html>
Given below my connector code.
[code]
package com;
import java.sql.Connection;
import java.sql.DriverManager;
import com.dhtmlx.connector.ConnectorServlet;
import com.dhtmlx.connector.DBType;
import com.dhtmlx.connector.SchedulerConnector;
public class Myconnector extends ConnectorServlet{
@Override
protected void configure() {
//obtain DB connection
try {
Connection conn=null;
Class.forName ("org.postgresql.Driver").newInstance ();
conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/sampleDb","postgres","postgre@123");
//Initialize connector
SchedulerConnector c = new SchedulerConnector(conn, DBType.PostgreSQL);
// c.servlet(req, res);
//configure used table and fields
c.render_table("events", "event_id", "start_date,end_date,details");
}
catch (Throwable e) {
e.printStackTrace();
}
}
}[/code]
Below output I am getting from the connector.
<?xml version='1.0' encoding='utf-8' ?><data><event id='2' ><start_date><![CDATA[2014-06-30 09:00:00]]></start_date><end_date><![CDATA[2014-06-30 12:00:00]]></end_date><text><![CDATA[french open coutrtier paris france new]]></text></event>
</data>
.
please suggest what I am lacking ?