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
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.
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 (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
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.
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
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!