I used order_brunch to re-order/drag&drop my tasks. But it didn’t save after re-ordering my updated tasks. I used onAfterTaskAdd, onAfterTaskUpdate used for updating my tasks. But it didn’t save when I re-order m y tasks.
Which will be great to use my re-ordering tasks?
Do you have any example for onAfterTaskMove? How can I get parent, tindex.
Hi Ramil, No i don’t have any column individually only for storing orders. But the task id works pretty much like orders. Also I sorting task according to Id’s. Now I want to save the new order task in Angular. If I add new column for only ordering tasks : how can I manipulate from angular?
gantt.attachEvent(‘onAfterTaskMove’, function(id, parent, tindex) {
Hello,
Thank you for the clarification.
The ID itself doesn’t mean the order position. If you reorder a task, its vertical position will change, but the ID will remain the same. After you reorder a task, Gantt should send the changes to the server side. Here is a video demonstrating it: https://files.dhtmlx.com/30d/0171031caaca1782a0c2150ae87aa67d/vokoscreen-2019-03-01_16-25-36.avi
If you really rely on the task ID to reorder tasks and sort tasks by ID after loading the data, that explains why the order is not saved, because sorting reset the order by the ID. If you update the task IDs after reordering it, you might encounter various issues. For example, Gantt uses the task ID to create links, save task under a parent and other things. So it is better to create an additional column in the database table to store the order of tasks.
If I add new column for only ordering tasks : how can I manipulate from angular?
Hi Ramil, Thanks a lot. I already create a new column.
My application is font end angular and back-end .net core.
Do I need to use gantt.attachEvent(‘onAfterTaskMove’, function(id, task, tindex) {)
In angular? And if I’m using ‘onTaskMove’ do I need to send id, task and tindex to save?