javascript - Kendo UI Gantt chart task lable change -
i trying change kendo ui gantt title. found 1 demo code, not working
<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> is possible change label on gantt bars ? want info on left side tree , other info on bars possible ? parent child relation not retaining if add gantt columns other title.
model: { id: "id", fields: { id: { from: "id", type: "number" }, descr : { : "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");
try starting uppercase:
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") }], edit:
answering comment: define columns definition:
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"), description: "some longer description" }], columns: [ { field: "id", title: "id", width: 60 }, { field: "title", title: "title", editable: true, sortable: true }, { field: "description", title: "description", width: 100, editable: true, sortable: true } ],
Comments
Post a Comment