Couldn't save records after re-order/dragging tasks?

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.

Hello,
Do you have a column in the database that stores the order?
Our guides describe how to implement that. Here are the examples:
https://docs.dhtmlx.com/gantt/desktop__howtostart_ruby.html#storingtheorderoftasks
https://docs.dhtmlx.com/gantt/desktop__howtostart_php.html#storingtheorderoftasks

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?

Please clarify what exactly you want to do.

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?

Hello,
Thank you for the clarification. Usually, you don’t need to use that event handler to send the changes to the backend after vertically reordering tasks. You need it only if you use a custom way to detect that something changed in the chart. If you use the Data Processor, it should detect the changes and send them to the server side:
https://docs.dhtmlx.com/gantt/desktop__server_side.html
https://docs.dhtmlx.com/dataprocessor__index.html
https://docs.dhtmlx.com/api__refs__dataprocessor.html