简体   繁体   English

dhtmlxscheduler与ASP.NET MVC5的用法

[英]dhtmlxscheduler usage with ASP.NET MVC5

I am trying to use dhtmlxscheduler within an ASP.NET MVC 5 application by following the guide available at http://docs.dhtmlx.com/scheduler/how_to_start.html but not having much joy. 我试图按照http://docs.dhtmlx.com/scheduler/how_to_start.html上提供的指南,在ASP.NET MVC 5应用程序中使用dhtmlxscheduler,但没有很多乐趣。 I have added v4.1.1 scripts and css to my project via NuGet. 我已经通过NuGet将v4.1.1脚本和CSS添加到了我的项目中。

I have created a new project and created a new view without layout, the controller action simply serves the view. 我创建了一个新项目并创建了一个没有布局的新视图,控制器操作只是为该视图提供服务。 Below is the HTML in my view but the page renders totally blank, what am I doing wrong? 下面是我认为的HTML,但是页面完全空白,我在做什么错? Also, how would I get this to work with a view that uses a layout? 另外,如何将其与使用布局的视图一起使用?

I am aware there is a dhtmlxscheduler .NET version available but this requires a license. 我知道有dhtmlxscheduler .NET版本可用,但这需要许可证。

@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>How to start</title>
<script src="@Url.Content("~/Scripts/dhtmlxscheduler/dhtmlxscheduler.js")" type="text/javascript"></script>
<link rel="stylesheet" href="@Url.Content("~/Content/dhtmlxscheduler/dhtmlxscheduler.css")" type="text/css">
<style type="text/css" media="screen">
    html, body {
        margin: 0px;
        padding: 0px;
        height: 100%;
        overflow: hidden;
    }
</style>
<script>
    scheduler.init("scheduler_here", new Date(), "month");
</script>
</head>
<body>
    <div>
        <div id="scheduler_here" class="dhx_cal_container" style="width:100%; height:100%;">
            <div class="dhx_cal_navline">
                <div class="dhx_cal_prev_button">&nbsp;</div>
                <div class="dhx_cal_next_button">&nbsp;</div>
                <div class="dhx_cal_today_button"></div>
                <div class="dhx_cal_date"></div>
                <div class="dhx_cal_tab" id="day_tab" style="right:204px;"></div>
                <div class="dhx_cal_tab" id="week_tab" style="right:140px;"></div>
                <div class="dhx_cal_tab" id="month_tab" style="right:76px;"></div>
            </div>
            <div class="dhx_cal_header"></div>
            <div class="dhx_cal_data"></div>
        </div>
    </div>
</body>
</html>

Turns out the issue/solution was already in the FAQ http://docs.dhtmlx.com/scheduler/faq.html#schedulerisntrenderedcorrectly 原来问题/解决方案已经在FAQ http://docs.dhtmlx.com/scheduler/faq.html#schedulerisntrendered中了

My containing div did not have a height set. 我的包含div没有设置高度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM