RadiantQ jQuery Gantt Package
How to export current Gantt data to JSON?
Previous Topic  Next Topic 

By default Gantt will automatically update the underling bound JSON task when the activity changed. So, you can simply export the bound list of tasks using JSON.stringify:


//To generate the json from the gantt's DataSource

$("#exportToJSON").click(function () {

    var jsonObject = gantt.options.DataSource;

    // Specify the fields you want to export, because when the CanInsertPropertyChangeTriggeringPropertiesInData gantt option is set    

    // it will add some custom property to your datasource which you typically do not want to export.

    alert(JSON.stringify(jsonObject, ["ID", "Name", "StartTime", "Effort", "Description", "IndentLevel", "Resources", "PredecessorIndices", "ProgressPercent"]));

})















� RadiantQ 2022. All Rights Reserved.