Gantt order by bug when dragging tasks

2 Answers 96 Views
Gantt wrapper
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 15 Jul 2021, 01:49 PM

Hi,

When using this example please see the attached video where the order by does not behave correctly.

After creation, tasks 'aaa' and 'bbb' have sequential order values, which is correct. After dragging 'bbb' above 'aaa' then both have the same order valule. It appears to be a bug?

2 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 20 Jul 2021, 01:20 PM
Hi Al.

The reason for the reported behavior is that the new elements are added with one and the same ID in the datasource of the component. This is not a bug but a feature that is already discussed in tickets you've submitted before.

The reason for this behavior is that the component is bound to a local datasource. The recommended way of using the Gantt component, when there are CRUD operations, is with a remote datasource. Thus, once a new task is created it is sent to the backed with an ID of 0. The ID of 0 is a signal for the backend service that the task it receives is a new one. When the new task is received in the backend, the service there should save it in the database and define the ID for the task.  

When the new task has a unique ID, the reported behavior won't replicate as you can check in this StackBlitz project.

Regards,


Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 21 Jul 2021, 09:04 AM

Thanks Petar,

I am aware of the requirement to use remote datasources to allow the backend to provide a unique task id, but that isn't my problem. I only used the stackblitz sample using 'localdatasource' for convenience to show the behaviour but in my project I am using remote datasources.

 

With further investigation I found the problem - somehow the order-by field in my database (in brackets below) got into the state below:

    task1 (0)
        task2 (1)
        task3 (2)
        task4 (3)

 

dragging task4 above task3 then the gantt does the updates to (incorrectly) set the order fields as below:

    task1 (0)
        task2 (1)
        task3 (2)
        task4 (2)

 

when the db order-by field in the DB is correct ie:

    task1 (0)
        task2 (0)
        task3 (1)
        task4 (2)


then dragging task4 above task3 the gantt correctly sets the order by as expected:

    task1 (0)
        task2 (0)
        task4 (1)
        task3 (2)

 

So the issue was with my data BUT it is a concerning that the gantt can get into this state ie. the order-by is no longer usable just due to the data's order-by values.

It still feels like a bug, should the gantt not handle this situation instead of breaking?

Petar
Telerik team
commented on 26 Jul 2021, 08:21 AM

Hi Al,

The order ID of the task, as you correctly have assumed, should be zero-based.

This requirement is not mentioned in the documentation. I've logged an internal task and soon this information will be easily accessible. Thank you for noting us about these missing documentation details.  

I've updated your Telerik points as a sign of gratitude for reporting the missing details.

Let me know if you have any other questions related to the current ticket.

Al
Top achievements
Rank 1
Iron
Iron
Iron
commented on 27 Jul 2021, 09:10 AM

Thanks Petar,

My gantt tasks can be created and updated by screens separate to the gantt which is how the order-by value ended up as described above.
So it seems that I need to maintain the order-by field in my DB manually whenever such external updates are performed...I still think the gantt should handle this better...
Plamen
Telerik team
commented on 29 Jul 2021, 04:04 AM

Yes indeed, the order ID of the task, as you correctly have assumed, should be zero-based.

This requirement is not mentioned in the documentation. I've logged an internal task and soon this information will be easily accessible. Thank you for noting us about these missing documentation details.  

You can also submit a feature request at out feedback portal for improvement of this behavior.

Regards,

Plamen

Tags
Gantt wrapper
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Petar
Telerik team
Al
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or