Save changes to Backend

Hi,

I'd like to implement a button that will push all changes to the backend. How do I get the modified records from the gantt: added records, updated records, and deleted records?


1 Reply

AG Ajithkumar Gopalakrishnan Syncfusion Team June 20, 2024 06:43 AM UTC

Hi Christian,


Greetings from Syncfusion Support,


To achieve this requirement, we suggest to use the actionComplete event in the Gantt chart. This event is triggered after CRUD operations, returning the modified taskData based on the requestType. After adding, deleting, or updating records, the respective collections are updated in the event. We have attached a code snippet and sample for your reference.

<ejs-gantt ref='gantt' id="GanttContainer"

           ...

           :actionComplete="actionComplete">

</ejs-gantt>

actionComplete: function(args)

{

    if (args.requestType == "save" || args.requestType == "delete")

    {

        this.changes.changedRecords = args.modifiedTaskData;

        if (args.requestType == "delete")

        {

            this.changes.deletedRecords = args.data[0].taskData;

        }

    }

    if (args.requestType == "add")

    {

        this.changes.addedRecords = args.newTaskData;

    }

 

},

pushChangesToServer()

{

    // handle server side call use to changes record's collection

}


Sample link: https://stackblitz.com/edit/tin6ws-nkwnz8?file=src%2FApp.vue


Contact us if you require any further assistance.

Regards,

Ajithkumar G


Loader.
Up arrow icon