How to get markTimespan dynamically?

Hi

Is any exact way to get block Date and Times (markTimespan) dynamically loading calendar ?

now all of the example, get markTimespan one time only. I want to get markTimespan on dynamically loading the view. I have lot of block times in my DB and can i get and show these block times like getting event using ‘scheduler.load’

Thank you.

Hello,
current version of the scheduler contains no built-in method to do so. However, the api methods for marked timespan takes simple JS objects as arguments
docs.dhtmlx.com/scheduler/api__s … espan.html
You can manually load timespans data from server on onViewChange event, and when the timespans are loaded, you’ll be able to add them to the calendar
docs.dhtmlx.com/scheduler/api__s … event.html
If you use a jQuery, the code might look following:

[code]scheduler.attachEvent(“onViewChange”, function (mode, date) {
var toStr = scheduler.date.date_to_str("%d-%m-%Y");
var start = scheduler.date[mode + “_start”](new Date(date));
var end = scheduler.date.add(start, 1, mode);
$.ajax({
dataType: “json”,
url: “url”,
data: {
from: toStr(start),
to: toStr(end)//stringify dates
},
complete: function (response) {
var timespans = JSON.parse(response.responseText); //preprocess loaded data if neaded

		// Remove previously loaded timespans
		scheduler.deleteMarkedTimespan({ type: "ajax_timespan" });

		for (var i = 0; i < timespans.length; i++) {
			var span = timespans[i];
			span.start_date = scheduler.templates.xml_date(span.start_date);
			span.end_date = scheduler.templates.xml_date(span.end_date);

			span.type = "ajax_timespan"; //add custom type, so all loaded timespans could be deleted

			span.css = "schedule_worktime";
			span.html = "Working";
			scheduler.addMarkedTimespan(timespans[i]);
		}
		scheduler.updateView();

	}

});

});[/code]