跳到主要内容

exportToJSON

Description

将甘特图的结构和数据导出为一个 JSON 对象

exportToJSON: (config?: any) => void

Parameters

  • config - object - 可选,是一个包含甘特图配置的对象

Example

gantt.exportToJSON({
name:"gantt.json"
});

Details

注释

本方法在 export 扩展中定义,因此需要激活 export_api 插件。

注释

如果您使用的 Gantt 版本低于 8.0,请在页面中包含 https://export.dhtmlx.com/gantt/api.js 以启用在线导出服务,例如:

<script src="codebase/dhtmlxgantt.js"></script>
<script src="https://export.dhtmlx.com/gantt/api.js"></script>

以下选项可用于 config 对象:

  • name - 导出的 JSON 文件名称
  • data - (array) 要导出的任务列表。如果未指定,将导出整个甘特图
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.