Kendo UI 未处理甘特图 JSON

Kendo UI Gantt chart not processing JSON

我尝试切换 Kendo UI 甘特图示例 PHP 中的数据源。我已经将模式与返回的内容进行了映射,但我只得到了一个带有一个标题的空白甘特图 - "undefined".

{
  "1": {
    "id": "1",
    "orderId": "1",
    "title": "TESTER1",
    "start": "\/new Date('2016-01-01 09:00:00')\/",
    "end": "\/new Date('2016-02-01 00:00:00')\/",
    "project": "1",
    "client": "4218",
    "parent": "0",
    "percentComplete": "10.11"
  },
  "2": {
    "id": "2",
    "orderId": "2",
    "title": "TESTER2",
    "start": "\/new Date('2016-01-03 09:00:00')\/",
    "end": "\/new Date('2016-02-01 00:00:00')\/",
    "project": "1",
    "client": "4218",
    "parent": "0",
    "percentComplete": "50.00"
  }
}

上面是 JSON 被发送回 Kendo,但它没有呈现。

找到解决方案:

我输入整数,将父项设置为空而不是零 (0),并在 PHP 层中将日期转换为毫秒,然后再传递到 Kendo。我还删除了导致创建以下 JSON 的键。这解决了我的渲染问题。

    [{
    "id": 1,
    "orderId": 1,
    "title": "TESTER1",
    "start": "\/Date(1463126400000)\/",
    "end": "\/Date(1463958000000)\/",
    "project": 1,
    "client": 4218,
    "parent": null,
    "percentComplete": 10
}, {
    "id": 2,
    "orderId": 2,
    "title": "TESTER2",
    "start": "\/Date(1463990400000)\/",
    "end": "\/Date(1464130800000)\/",
    "project": 1,
    "client": 4218,
    "parent": null,
    "percentComplete": 50
}]