Serialize data to XML and JSON

dhtmlxGantt is a fully functional Gantt chart for cross-browser and cross-platform applications. It can meet all the needs of project management applications and is the most complete Gantt chart library. It allows you to create dynamic Gantt charts and visualize project progress in a convenient graphical way. With dhtmlxGantt, you can display the dependencies between activities, display the current task status with a shadow of completion percentage, and organize activities into a tree structure.

Click to download the trial version of dhtmlxGantt

JSON format

To serialize data from the Gantt chart to a JSON object, use the serialize method as shown below:

var json = gantt.serialize();

As a result, the json variable in the above code will look like this:

{
    
    
 "data": [{
    
    "id":"1", "text":"Project #1", "start_date":"01-04-2013 00:00", ...}, ...], 
 "links":[{
    
    "id":"1", "source":"1", "target":"2", "type": "1"}, ...]
}

XML format

To serialize the data in the Gantt chart into XML strings, use the serialize method, as shown below:
var xml = gantt.serialize("xml");
As a result, the xml variable in the above code will be as follows:

"<data>
    <task id='11' parent=''   start_date='01-04-2013 00:00' duration='11' 
     open='true' progress='0.6' end_date='12-04-2013 00:00'>
        <![CDATA[Project #1]]>
    </task>
    <task id='12' parent='11' start_date='03-04-2013 00:00' duration='5' 
     open='true' progress='1' end_date='08-04-2013 00:00'>
        <![CDATA[Task #1]]>
    </task>
</data>"

APS helps improve the production efficiency of enterprises, truly realize the visual presentation and control of production plans, quickly and effectively respond to production plans in different scenarios, improve on-time delivery capabilities, and increase production capacity and resource utilization.

Guess you like

Origin blog.csdn.net/RoffeyYang/article/details/112522451