I use unitsview, weekview and decadeview *customized to shw 30days).
I face problem in loading events from database, when i load events from database ,eventbox gets loaded in the first column of unitsview and it same happens in weekview and monthview.
hereis myscreenshot of unitsview attached.
I use customized eventbox to render events.
[code] public ActionResult Index()
{
var scheduler = new DHXScheduler();
ViewBag.scheduler = scheduler;
scheduler.LoadData = true;
scheduler.EnableDataprocessor = true;
scheduler.Views.Add(new DecadeView()
{
Label = “Decade”
});
scheduler.Config.hour_date = “%h:%i%A”;
scheduler.Config.xml_date = “%d/%m/%Y %H:%i”;
scheduler.BeforeInit.Add("customeventbox()");
scheduler.BeforeInit.Add("configureScales()");
var evBox = new DHXEventTemplate();
scheduler.XY.min_event_height = 1;
scheduler.Config.day_date = "%l </br> %d %F";
scheduler.Extensions.Add(SchedulerExtensions.Extension.ContainerAutoresize);
scheduler.InitialDate = DateTime.Today;
scheduler.Config.start_on_monday = true;
scheduler.Config.drag_create = false;
scheduler.Skin = DHXScheduler.Skins.Standart;
scheduler.Config.week_date = "%j %D";
scheduler.Config.mark_now = false;
var unit = new UnitsView("units", "ID");
scheduler.Views.Add(unit);
List<GetResourceOrderDisplay_Result> resourcedisplayname = new List<GetResourceOrderDisplay_Result>();
resourcedisplayname = _scheduler.Getresorderdisplay();
var options = new List<object>();
unit.AddOptions(resourcedisplayname.Select(u => new { key = u.ID, label = u.DisplayName }));
scheduler.InitialView = "units";
scheduler.DataAction = Url.Action("Data", "Scheduler");
return View(scheduler);
#endregion
}[/code]
public ContentResult Data()
{
var scheduler = new DHXScheduler();
scheduler.InitialDate= DateTime.Today ;
var data = new SchedulerAjaxData(new Entities().GetAppDisplay(scheduler.InitialDate).Select(e => new { id = e.ID, e.ResourceID, start_date = e.StartTime, end_date = e.Duration, e.Color, text = "" }));
data.DateFormat = "%d/%m/%Y %H:%i";
return data;
}
[code]function customeventbox() {
//customevenbox
scheduler.attachEvent(“onTemplatesReady”, function () {
scheduler.templates.event_header = function (start, end, ev) {
return scheduler.templates.event_date(ev.start_date) + "- " +
scheduler.templates.event_date(ev.end_date)
}
scheduler.templates.event_text = function (start, end, ev) {
return “” + ev.Color + “
” + ev.ResourceID + “”;
}
});
//decadeview
scheduler.attachEvent(“onTemplatesReady”, function () {
scheduler.date.decade_start = function (date) {
var ndate = new Date(date.valueOf());
ndate.setDate(Math.floor(date.getDate() / 10) * 10 + 1);
return this.date_part(ndate);
}
SetTiming();
scheduler.templates.decade_date = scheduler.templates.week_date;
scheduler.templates.decade_scale_date = scheduler.templates.week_scale_date;
scheduler.date.add_decade = function (date, inc) {
return scheduler.date.add(date, inc * 30, “day”);
}
});
}[/code]