Our state of the art Gantt chart


Post by rahulranjan »

Hi
How to get modified or deleted data from task editor pop . from each tab so that i can send it to backed to save it in DB.
I don't want to get the data which is not change.

Post by pmiklashevich »

For each project store you can see changes. For each changed record you can get modifications
gantt.project.taskStore.changes
gantt.project.taskStore.changes.modified[0].modifications

Pavlo Miklashevych
Sr. Frontend Developer


Post by rahulranjan »

Hi
The way which you are telling will always return the first task. But i want some thing else
Let say
1. I have selected a task .
2. click on edit task.
3. modified the particular record let say name
4. Then save it

Now when i do
this.gantt.taskStore.changes - it returns all the records which are not modified also.

Post by pmiklashevich »

The way which you are telling will always return the first task.
Yes, because I provide you not ready-to-use code but codesnippets to show you an idea.

You need to send data to server after the changes are saved in TaskEditor? Is that correct? If so, you just need to call gantt.project.sync() when editor is getting closed. For example:
    features : {
        taskEdit : {
            editorConfig : {
                listeners : {
                    beforeclose : () => gantt.project.sync()
                }
            }
        },
But the same way you can have a separate button on the page which will trigger "sync" manually

Also you can set autoSync to true to get your changes synced automatically no matter if they were done by taskeditor/celleditor/console/some custom editor etc.

Pavlo Miklashevych
Sr. Frontend Developer


Post by jandresampaio »

I'm having the same problem with changes afecting all the records with no relation between the modified record and the "others" that appear in modified property. Normally it's because of the "id" property being changed...how do we prevent this from happening ?

In Ext versions we compared the values and made a commit to a task (task.commit()) to prevent these records from being sent to the server.

Also, when one is not using crudManager, how does sync helps ?

Post by Maxim Gorkovsky »

changes afecting all the records with no relation between the modified record and the "others" that appear in modified property
Could you please elaborate on this? What kind of changes? How does one change cause another if there's no relation?

Maybe you need a commit method on store?

Post by jandresampaio »

Could you please elaborate on this? What kind of changes? How does one change cause another if there's no relation?
ProjectModel appears in the changes.modified with the modifications "id": "_generatedprojectmodel1" when we change a name of a task.

The commit would only make sense after a successfull request to the server, correct ?

Post by Maxim Gorkovsky »

I tried to reproduce this on online advanced demo and cannot see the problem. Project model doesn't appear (and shouldn't) in changeset. Could you please provide a test case or steps to reproduce on our demo?
The commit would only make sense after a successfull request to the server, correct ?
Yes, that is correct.

Post by jandresampaio »

Ok. I'll follow the steps mentioned in other ticket to extend task model and use Id as "id" and see if this works. But if it doesn't, I'll make a project for you to check.


Thanks.

Post by jandresampaio »

Hi,

I've found that in Advanced demo you can replicate this when you add a sibling task of root task, where a modified ProjectModel object appears in changes.

This image is from the attached project, where additional 5 tasks appear as modified when adding a sibling task of the root task.
Changes when adding a sibling task on the project root.PNG
Changes when adding a sibling task on the project root.PNG (289.15 KiB) Viewed 1805 times

Our problem here is that with previous versions we could just commit a single task and ignore the changes, but we could not yet figure out how we can do this we bryntum gantt js version.

Thank you.
Attachments
advanced.zip
(1.81 MiB) Downloaded 90 times

Post Reply