Skip to main content

serialize

Description​

Serializes the data into JSON or XML format

serialize: (type?: string, options?: { order?: "display" | "canonical" }) => any

Parameters​

  • type - (optional) string - the format that the data will be serialized into.
    Possible values: 'json' (default ), 'xml'.
  • options - (optional) object - set order to "display" or "canonical" to choose the task order in JSON.

Returns​

  • data - (object) - a gantt data object

Example​

gantt.serialize('xml');

Details​

JSON normally follows the current display order. With the wbs extension active, it follows the canonical hierarchy and sibling order by default. Pass gantt.serialize("json", { order: "display" }) to serialize in display order in either case.

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.