Hi Yu
Kawamura,
Greetings from Syncfusion Support,
To meet your requirement, we recommend
storing the data in database or browser local storage, after drag and drop
action. On loading page, retrieve data from database or browser local storage
so that updated data will be used. Use actionComplete
and load
events of gantt to achieve this requirement. After a drop action, store the
data source in local storage. Then, upon reloading, update the stored data
source in the Gantt chart instance. We have attached a code snippet and sample
for your reference.
Ug link: Local-Storage
<ejs-gantt ref='gantt' id="GanttContainer"
…
:allowTaskbarDragAndDrop="true"
:actionComplete="actionComplete"
:load="load">
</ejs-gantt>
data: function()
{
return{
…
actionComplete:
function(args) {
if (args.requestType
== "rowDropped")
{
var ganttObj =
document.getElementById('GanttContainer').ej2_instances[0];
window.localStorage.setItem('ganttGanttArray',
JSON.stringify(ganttObj.dataSource));
}
},
load: function(args) {
let storedData = window.localStorage.getItem('ganttGanttArray');
let retrievedArray = JSON.parse(storedData);
if (retrievedArray !==
null &&
retrievedArray.length > 0)
{
var ganttObj =
document.getElementById('GanttContainer').ej2_instances[0];
ganttObj.dataSource = retrievedArray;
}
}
};
},
|
Sample link: https://stackblitz.com/edit/t4bfnw-8xqt2t?file=src%2FApp.vue
If you have any specific
concerns or encounter issues, please provide additional details or share a
sample that replicates the problem. We are here to assist you further.
Regards,
Ajithkumar G