Page 1 of 1

[INFO REQ] [.NET CORE] Import & Merge with existing schedule

Posted: Mon Oct 11, 2021 12:34 pm
by awakeb1

Hi Support Team,

I want to merge current schedule with the file I imported. this is the data I merged and will load to bryntum gantt:

data.json
(591.35 KiB) Downloaded 85 times

Here is my ImporterMerge.js

ImporterMerge.js
(6.46 KiB) Downloaded 77 times

Here is my app.js

app.js
(7.38 KiB) Downloaded 79 times

In app.js please take a look at line 218:

gantt.crudManager.on('load', function () {
    //Call ajax to load data.json and pass to ImporterMerge.js
    //This is example of call importer
    //await importer.importData(response.data);

//gantt.setStartDate(gantt.project.startDate);
//await gantt.scrollToDate(gantt.project.startDate, { block: 'start' });
});

Let me explain the logic:

  • First I load bryntum with an empty data

  • After project loaded it will trigger event "load" of gantt.crudManager. Inside this event I will call ajax to load data, example here I load data.json and pass this data to ImporterMerge.js

  • In this ImporterMerge.js I do as: tasks imported and already existed in the current schedule I will keep id, tasks imported with no existed with current schedule I will remove id, mean this task will be added new.

To this step everything is ok. Because I checked:

  • Some tasks need to create new will have isPhantom = true, and id has a string format. Example: "_generatedClassDefEx1"

  • Some tasks need to update will have id > 0

My problem is when I click Save, all tasks are added new. Please help me take a look at some files I attached and help me why some tasks have id > 0 but when sync, bryntum send them to server inside syncRequest.tasks.added. I think they have to be inside syncRequest.tasks.updated

Note: I used bryntum gantt v4.2.5
Thanks


Re: [INFO REQ] [.NET CORE] Import & Merge with existing schedule

Posted: Mon Oct 11, 2021 12:46 pm
by awakeb1

Here is my data after run ImporterMerge.js and load on bryntum gantt.

merge.png
merge.png (95.83 KiB) Viewed 1202 times

Re: [INFO REQ] [.NET CORE] Import & Merge with existing schedule

Posted: Wed Oct 13, 2021 5:05 pm
by Maxim Gorkovsky

Hello.
Normally only phantom tasks should appear in added array in the outgoing request. I couldn't check your example because it is not runnable. Please wrap this into smth that we can run locally and investigate outgoing request.


Re: [INFO REQ] [.NET CORE] Import & Merge with existing schedule

Posted: Mon Oct 18, 2021 1:46 pm
by awakeb1

Hi,

Please check attachment aspnetcore.zip below and do the steps:

  • Run app

  • After data is loaded, click on "Merge data" button, it will load data_already_merged.json file. Some green tasks are add new, Some yellow tasks are reschedule

And data will be look like this after "Merge data" button is clicked

merge.PNG
merge.PNG (87.85 KiB) Viewed 1166 times

Please try to make breakpoint at Sync action on GanttCrud controller and click Save button, you will see all data in added array. My expectation:

  • 4 New Tasks will be in added array

  • 27 Reschedule Tasks will be in updated array

Note:

  • Event Click of Merge data button in index.html file[

  • No connect database just load json file and all files located in wwwroot\data

Thanks.


Re: [INFO REQ] [.NET CORE] Import & Merge with existing schedule

Posted: Thu Oct 21, 2021 6:20 pm
by alex.l

Hi awakeb1,

We cannot run the app you provided. Looks like some configs files are missing and configs from our examples are not working if we used them instead. Please try to attach a full, runnable app.


Re: [INFO REQ] [.NET CORE] Import & Merge with existing schedule

Posted: Wed Oct 05, 2022 3:12 pm
by awakeb1

Hi Alex, please can you advice if I can add Indent & Outdent as a bottom in the top menu, and the same for Predecessor and Successor. Thanks in advance


Indent and Outdent as a bottom in the top menu

Posted: Wed Oct 05, 2022 3:43 pm
by awakeb1

please can you advice if I can add Indent & Outdent as a bottom in the top menu, and the same for Predecessor and Successor. Thanks in advance


Re: [INFO REQ] [.NET CORE] Import & Merge with existing schedule

Posted: Thu Oct 06, 2022 4:14 pm
by alex.l

Hi awakeb1,

Please make a new thread for new question. It doesn't sound relevant to original post.
And please provide more details what is "as a bottom in the top menu", I can't get your idea.
Thank you!