Kendo UI Gantt jumps timeline somewhere when item is created with pushUpdate

1 Answer 97 Views
Gantt
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
Vedad asked on 05 Jul 2022, 01:16 PM

Hi,

I am not sure if this is a bug or expected behavior, but I observed that when I create element in Gantt widget using pushUpdate, gantt timeline "jumps" to some position. For me locally it jumps to today, on example dojo (attached below) it jumps to other position.

I did some debugging locally and as I could see this line in code triggers this focus:

            pushUpdate: function (items) {
                if (!isArray(items)) {
                    items = [items];
                }
                var pushed = [];
                for (var idx = 0; idx < items.length; idx++) {
                    var item = items[idx];
                    var model = this._createNewModel(item);
                    var target = this.get(model.id);
                    if (target) {
                        pushed.push(target);
                        target.accept(item);
                        target.trigger(CHANGE); //FOR ME HERE IT FOCUSES
                        this._updatePristineForModel(target, item);
                    } else {
                        this.pushCreate(item);
                    }
                }
                if (pushed.length) {
                    this.trigger('push', {
                        type: 'update',
                        items: pushed
                    });
                }
            },

Behavior can be observed on this dojo, with the following steps:
 - run dojo

- position gantt timeline somewhere in the future (i tried several dates)

- click 'add item' button to add EXAMPLE element via pushUpdate

Result: Gantt "jumps" the timeline (at least for me) to 05.07. - 06.07.

 

Thank you and regards

Vedad

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 08 Jul 2022, 09:26 AM

Hello, Vedad,

I have recorded a small video to demonstrate how the example works on my side. You can see that it seems to behave as expected. Could you please let me know if I am missing something to reproduce the issue? 

Looking forward to your reply.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
commented on 08 Jul 2022, 09:33 AM

Hello Martin, 

your video shows exactly what I see.. When you add item, gantt timeline jumps somewhere, but it should remain where it was..

Thing is, I update gantt with pushUpdate with delay, after delayed response from the system, and basically, I am working on task which is somewhere else in timeline, and all of the sudden, my timeline jumps.

I think pushUpdate shouldn't affect timeline at all..

Thank you very much
Vedad

Martin
Telerik team
commented on 13 Jul 2022, 09:29 AM

As you are adding a new item under the Research parent task, the newly added EXAMPLE task will be added at the bottom. As a result, the tasks after it will also need to move 1 row below. The behaviour is expected as the newly added task will have no appropriate place to go. Additionally, I would advise selecting the tasks using their id/uid instead of through the index.
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
commented on 13 Jul 2022, 03:20 PM

HI Martin, 

vertical position of the task is not in question, it is logical position, as you mentioned.

My problem is horizontal scrolling of gantt timeline. I scroll timeline to see what is happening with some other task in timeline, and the moment new task is added gantt timeline horizontally jumps to other position - it would be logical that timeline remains where it is. Please observe attached video.

If you have any question, I am available.

Thank you

Vedad

 

Martin
Telerik team
commented on 18 Jul 2022, 09:01 AM

Hi, unfortunately I am unable to reproduce the scrolling behaviour from the last video. Could you please let me know if you can replicate it in this example, or if any modifications are necessary? Maybe I am missing a step? Also, which browser are you using?
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
commented on 22 Jul 2022, 03:55 PM

Hi Martin, 

Thank you for your answer. I am using latest Chrome.

there is something strange with this dojo..

I change project duration to end on the same date only in 2022 and save, then I click add item.

Item is added, but project is changed to its previous year and marked as edited, timeline jumps somewhere..

I am not sure what to tell you.. but something is strange. I will try to record video with my system to show you.

Thanks

Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
commented on 03 Aug 2022, 11:05 AM

Hi Martin,

all of the sudden I cannot reproduce it anymore in the dojo you provided.. so I guess we simply quit this one. :)

Sorry for taking your time but it is really strange.

thanks a lot

Tags
Gantt
Asked by
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
Answers by
Martin
Telerik team
Share this question
or