This is a migrated thread and some comments may be shown as answers.

not working: DragEndEvent index/oldIndex

4 Answers 12 Views
Sortable
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 26 Aug 2019, 02:19 PM

Hi,

here: https://stackblitz.com/edit/angular-k3ifma-sth4cf

i've implemented the following:

public onDragEnd(args: DragEndEvent): void {
  if (args.oldIndex !== args.index) {
    console.log('update server');
  } else {
    console.log('nothing has changed', args);
  }
}

 

When dragging and dropping, the if will never be true, the values of index and oldIndex are nearly always the same.

Why? Is this a bug?

Kind regards

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 Aug 2019, 01:25 PM
Hi,

Yes, this is a bug. It should be fixed in the latest dev version of the sortable packege - updated example.

Regards,
Daniel
Progress Telerik
Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Christian
Top achievements
Rank 1
answered on 30 Aug 2019, 02:42 PM

Hi,

thanks, i can confirm that this bug is fixed in the current dev-version.

When can we expect a new release?

Kind regards

0
Dimiter Topalov
Telerik team
answered on 03 Sep 2019, 07:47 AM

Hello Christian,

We just released the 3.0.1 version of the Sortable package that contains the discussed fix. It should be already available via NPM.

Regards,
Dimiter Topalov
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Christian
Top achievements
Rank 1
answered on 03 Sep 2019, 08:01 AM

Hi Dimiter,

thank you very much

Kind regards

Tags
Sortable
Asked by
Christian
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Christian
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or