0
DHTMLXScheduler를 MVC5 웹 응용 프로그램에 사용하여 환자를 추가하고 환자의 약속을 표시하고 달력에 표시하지만 데이터베이스에서 데이터를 가져 오는 중 문제가 있습니다. start_time 및 end_time에 따라 레코드가 추가되지 않습니다.데이터베이스에서 레코드를 가져와 DHTMLXScheduler에서 이벤트로 표시하는 방법 Calendar
달력 컨트롤러 :
public ActionResult Index()
{
var sched = new DHXScheduler(this);
sched.Skin = DHXScheduler.Skins.Terrace;
sched.LoadData = true;
sched.EnableDataprocessor = true;
sched.InitialDate = new DateTime(2016, 5, 5);
sched.Config.xml_date = "%d-%M-%Y %g:%i:%s%A";
return View(sched);
}
public ContentResult Data()
{
return (new SchedulerAjaxData(
new Entities().AppointmentsLogs.Select(e=> new { id = e.AppointmentId, start_date = e.StartTime.ToString(), end_date=e.EndTime, text = e.PatientName })
// .Select(e => new { e.id, e.text, e.start_date, e.end_date })
)
);
}
Index.cshtml : 당신이 다른 형식으로 시작 날짜와 종료 날짜를 보내처럼
<!DOCTYPE html>
<html>
<head>
<title>DHXScheduler initialization sample</title>
<style>
body {
background-color: #eee;
}
</style>
</head>
<body>
<div name="timeline_tab" style="height:700px;width:900px;margin:0 auto">
@Html.Raw(Model.Render())
</div>
</body>
</html>
<script src="~/scripts/dhtmlxScheduler/dhtmlxscheduler.js"></script>
<script src="~/scripts/dhtmlxScheduler/ext/dhtmlxscheduler_timeline.js"></script>