Kendo UI Gantt图表任务标签更改

时间:2015-05-11 13:04:17

标签: javascript kendo-ui

我正在尝试更改Kendo UI Gantt标题。我找到了一个演示代码,但它无法正常工作

 <div id="gantt"></div>
<script>
$("#gantt").kendoGantt({
  dataSource: [{
     id: 1,
     orderId: 0,
     parentId: null,
     title: "Task1",
     start: new Date("2014/6/17 9:00"),
     end: new Date("2014/6/17 11:00")
  }],
  messages: {
    views: {
      editor: {
        editorTitle:"Edit Task"
      }
    }
  }
});
</script>

是否可以更改甘特条形图上的标签? 我想要左侧树上的一些信息和栏上的其他信息是否可能? 如果我添加除标题之外的甘特列,则父子关系不会保留。

    model: {
                        id: "id",
                        fields: {
                            id: { from: "ID", type: "number" },
                            descr : { from : "DESCR", type: "string"},
                            orderId: { from: "ORDERID", type: "number", validation: { required: true } },
                            parentId: { from: "PARENTID", type: "number", defaultValue: null, validation: { required: true } },
                            start: { from: "START", type: "date" },
                            end: { from: "END", type: "date" },
                            Title: { from: "TITLE", defaultValue: "", type: "string" },
                            percentComplete: { from: "PERCENTCOMPLETE", type: "number" },
                            summary: { from: "SUMMARY", type: "boolean" },
                            expanded: { from: "EXPANDED", type: "boolean", defaultValue: true }
                        }
                    }

 var gantt = $("#gantt").kendoGantt({
                dataSource: tasksDataSource,

                views: [
                    "day",
                    "week",
                    "month",
                    { type: "year", selected: true },
                ],
                columns: [
                    { field: "descr", title: "Descr", editable: true, sortable: true },

                ],
                height: 400,

                showWorkHours: false,
                showWorkDays: false,

                snap: false
            }).data("kendoGantt");


            var gantt1 = $("#gantt1").kendoGantt({
                dataSource: tasksDataSource1,
                views: [
                    "day",
                    "week",
                    "month",
                    { type: "year", selected: true },
                ],
                columns: [
                    { field: "title", title: " ", editable: true, sortable: true },

                ],
                height: 400,

                showWorkHours: false,
                showWorkDays: false,

                snap: false
            }).data("kendoGantt");

1 个答案:

答案 0 :(得分:0)

尝试以大写字母开头:

static

编辑:

回答你的评论: 定义列定义:

dataSource: [{
     ID: 1,
     OrderId: 0,
     ParentId: null,
     Title: "Task1",
     Start: new Date("2014/6/17 9:00"),
     End: new Date("2014/6/17 11:00")
  }],