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

kendo-grid and material cdk drag/drop

1 Answer 483 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 02 Jun 2020, 04:27 PM
Is it possible to use material cdk to drag and drop rows within a kendo-grid?  How would cdkDrag directive be applied to the rows?

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 04 Jun 2020, 07:11 AM

Hi Thomas,

As the CDK Drag and Drop API seems to rely on directives, applied to the DOM elements that will be draggable and for the dropzones, this approach is inapplicable to the Grid, as it has its own complex rendering logic, and the developer does not have access to the DOM elements that are dynamically generated, based on the Grid configuration and data.

In theory, a Grid cell template could be used to provide an element with the  cdkDrag directive, e.g.: <div cdkDrag cdkDragRootElement="tr"...

However, I could not find a suitable place for the cdkDropList directive so that the reordering can work, and the event, required for modifying the Grid data to reflect the current items order, is not fired, e.g.:

https://stackblitz.com/edit/angular-cqbe6b-tqhs7y?file=app/app.component.ts

This is why the CDK Drag and Drop API cannot be used to reorder Grid rows.

If we find a reliable way to integrate the Drag and Drop API in our Grid component, we will share all relevant information, but currently this integration is not supported.

Thank you for the understanding.

You can also take a look at the following online demo showing a sample approach for reordering the Grid rows:

https://www.telerik.com/kendo-angular-ui/components/grid/how-to/row-reordering/

Regards,
Dimiter Topalov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Pooja
Top achievements
Rank 2
commented on 01 Mar 2024, 09:17 AM

Hello Team,

We have similar requirement where we want to use the cdk drag to drag the elements and drop it over kendo-scheduler(Angular).

Is there any development on this?

Tags
General Discussions
Asked by
Thomas
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or