我目前在Asp.net MVC应用程序中使用Dhtmlx Scheduler的免费客户端版本。我不熟悉Dhtmlx,刚开始使用它,所以很多提示/建议/提示会有很大帮助!
我在线跟踪了一些教程,当我在本地运行程序时,它们似乎都没有显示我的图表。那是为什么?
一个附带问题,我计划整合拖放功能,这是否可以作为自定义事件添加?
非常感谢所有人!
脚本:
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";
//===============
//Configuration
//===============
var sections=[
{key:1, label:"James Smith"},
{key:2, label:"John Williams"},
{key:3, label:"David Miller"},
{key:4, label:"Linda Brown"}
];
scheduler.createTimelineView({
name: "timeline",
x_unit: "hour",
x_step:8,
x_date: "%g%a",
x_size: 30,
x_length: 30,
y_unit: sections,
event_dy:'full',
y_property: "section_id",
render:"bar"
});
scheduler.init('scheduler_here',new Date(2014,3,7),"timeline");
scheduler.parse([
{ start_date: "2014-04-07 09:00", end_date: "2014-04-07 20:00", text:"Task A-12458", section_id:1},
{ start_date: "2014-04-09 06:00", end_date: "2014-04-09 22:00", text:"Task A-89411", section_id:1},
{ start_date: "2014-04-08 12:00", end_date: "2014-04-08 24:00", text:"Task C-32421", section_id:2},
{ start_date: "2014-04-07 14:30", end_date: "2014-04-07 19:00", text:"Task C-14244", section_id:3}
],"json");
视图:
<div id="scheduler_here" class="dhx_cal_container" style='width:1200px; 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>
<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>
</div>
答案 0 :(得分:0)
我想通了,我最终把脚本放在div中,id =“scheduler_here”