unfortunetly, placing the xml data on the page does not seem to be working either.
I’ll post all my code for the scheduler:
<div id='scheduler_here' class="dhx_cal_container" style='width:1130px; height:900px;'>
<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>
<input type="button" id="save" value="save" onclick="save()">
<div class="dhx_cal_date"></div>
<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
<div class="dhx_cal_tab" name="timeline_tab" style="right:280px;"></div>
<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
</div>
<div class="dhx_cal_header">
</div>
<div class="dhx_cal_data">
</div>
<textarea id="data_here">
<data>
<event>
<start_date>
<![CDATA[ 2014-07-15 08:30 ]]>
</start_date>
<end_date>
<![CDATA[ 2014-07-15 12:15 ]]>
</end_date>
<text>
<![CDATA[ Task A-12458 ]]>
</text>
<engineer_id>
<![CDATA[ 020602 ]]>
</engineer_id>
<id>
<![CDATA[ 1405426499962 ]]>
</id>
</event>
<event>
<start_date>
<![CDATA[ 2014-07-15 12:00 ]]>
</start_date>
<end_date>
<![CDATA[ 2014-07-15 14:00 ]]>
</end_date>
<text>
<![CDATA[ Task A-89411 ]]>
</text>
<engineer_id>
<![CDATA[ 020602 ]]>
</engineer_id>
<id>
<![CDATA[ 1405426499963 ]]>
</id>
</event>
<event>
<start_date>
<![CDATA[ 2014-07-15 11:00 ]]>
</start_date>
<end_date>
<![CDATA[ 2014-07-15 14:00 ]]>
</end_date>
<text>
<![CDATA[ Task A-89411 ]]>
</text>
<engineer_id>
<![CDATA[ 010201 ]]>
</engineer_id>
<id>
<![CDATA[ 1405426499964 ]]>
</id>
</event>
</data>
</textarea>
<script type="text/javascript">
var engineers = @Html.Raw(Json.Encode(ViewBag.engineers))
scheduler.locale.labels.timeline_tab = "Timeline";
scheduler.locale.labels.timeline2_tab = "Timeline2";
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.limit_view = false;
scheduler.config.mark_now = false;
scheduler.createTimelineView({
name: "timeline",
x_unit: "minute",
x_step: 30,
x_start: 16,
x_date: "%H:%i",
x_size: 24,
x_length: 48,
y_unit: engineers,
event_dy: 'full',
y_property: "engineer_id",
render: "bar"
});
//Days: monday - friday, Zones/Hours: 7pm - 12am
scheduler.blockTime({
days: [1, 2, 3, 4, 5],
zones: [19 * 60, 24 * 60],
//sections: {
// unit: [1, 4]
//}
});
scheduler.attachEvent("onAfterLightbox", function () {
setToolTip();
//save();
});
scheduler.attachEvent("onYScaleClick", function (index, section, e) {
setToolTip();
});
scheduler.attachEvent("onLimitViolation", function (id, obj) {
alert("This is not a valid time period.")
});
scheduler.init('scheduler_here', new Date(), "timeline");
//scheduler.load("/Tasks.xml", "xml");
scheduler.parse(document.getElementById("data_here").value, "xml");
function save() {
var xml = scheduler.toXML();
var url = '@Url.Action("Save", "Home")';
$.ajax({
url: url,
Type: "POST",
dataType: 'json',
async: false,
data: { xmlString: xml },
contentType: 'application/json; charset=utf-8',
success: alert("File Saved in C:\\ Drive as Tasks.xml")
});
}
</script>
</div>
I really do appreciate all your help Stanislav!
A big thank you!