【问题标题】:Dhtmlx Gantt Chart - Minor IssueDhtmlx 甘特图 - 小问题
【发布时间】:2011-06-03 12:09:33
【问题描述】:

我已经设置了 DHTMLX 甘特图 (http://dhtmlx.com/docs/products/dhtmlxGantt/index.shtml)。我正在加载原始 xml 数据,而不是 xml 文件。

但是,我收到一条警告说“无法解析此 XML 字符串”。但是当我单击“确定”时,甘特图会正常显示。

下面是我正在使用的代码:

var $_ = jQuery;
$_(document).ready(function() {
window.createChartControl = function(htmlDiv1){
    var ganttChartControl = new GanttChart();
    ganttChartControl.setImagePath("../../../../lib/plugins/html/gui/dhtmlx/gantt/1.3/codebase/imgs/");

    ganttChartControl.create(htmlDiv1);

    var xml_data_str = '<projects><project id="1" name="Project 1" startdate="2006,12,14"><task id="1"><name>Task 1 of Project 1</name><est>2006,12,14</est><duration>20</duration><percentcompleted>20</percentcompleted><predecessortasks></predecessortasks><childtasks><task id="11"><name>Sub Task 1 of Task 1 of Project 1</name><est>2006,12,14</est><duration>5</duration><percentcompleted>10</percentcompleted><predecessortasks></predecessortasks><childtasks></childtasks></task><task id="12"><name>Sub Task 2 of Task 1 of Project 1</name><est>2006,12,15</est><duration>10</duration><percentcompleted>20</percentcompleted><predecessortasks>11</predecessortasks><childtasks></childtasks></task></childtasks></task></project><project id="2" name="Project 2" startdate="2006,12,17"><task id="2"><name>Task 1 of Project 2</name><est>2006,12,17</est><duration>60</duration><percentcompleted>20</percentcompleted><predecessortasks></predecessortasks><childtasks><task id="21"><name>Sub Task 1 of Task 1 of Project 2</name><est>2006,12,17</est><duration>40</duration><percentcompleted>20</percentcompleted><predecessortasks></predecessortasks><childtasks></childtasks></task></childtasks></task></project></projects>';
    ganttChartControl.loadData(xml_data_str, false, false);
    }

window.createChartControl('chart_dhtmlx_gantt_2');
});

相关位是 XML 数据。我设置的方式有问题吗?!

请提供帮助。

谢谢。

【问题讨论】:

    标签: gantt-chart dhtmlx


    【解决方案1】:

    在论坛上查看此帖子 http://forum.dhtmlx.com/viewtopic.php?f=15&t=15909&p=48639&hilit=loaddata#p48639

    代码中有一个错误...

    【讨论】:

      猜你喜欢
      • 2020-05-07
      • 2016-07-22
      • 2016-05-25
      • 1970-01-01
      • 2016-08-13
      • 2015-12-05
      • 2020-04-24
      • 2020-06-17
      • 1970-01-01
      相关资源
      最近更新 更多