Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

angular ej1 grid: dragAndDrop #1

Open
ninopetrovic opened this issue Dec 3, 2018 · 2 comments
Open

angular ej1 grid: dragAndDrop #1

ninopetrovic opened this issue Dec 3, 2018 · 2 comments

Comments

@ninopetrovic
Copy link

Hello,

I implemented a grid in my website with dragAndDrop enabled and it works fine. But, i dont like that i have to select the row first before draging it to wanted position. if i just try to drag it, it instantly goes to multiselecting rows. If i try to disable multiselect it does't do anything.

B.R. Nino Petrovic

@VigneshNatarajan27
Copy link

Hi Nino

We understand that you need to prevent the multiselection on dragging the mouse and drop the row in selected index without selecting the record. We have achieved your requirement using rowDragStart event of ejGrid. In that event we have selected the dragged row. So that dragged element can be dropped properly at specific index.

<ej-grid #grid [dataSource]="gridData" (rowDragStart)="onRowDragStart($event)">

onRowDragStart(e: any){ 
     this.Grid.widget.selectRows(e.target.index()); 
}

Refer the below link for the JS playground sample

Sample: https://jsplayground.syncfusion.com/kgcjrd0i

Refer the API documentation for your reference

https://help.syncfusion.com/api/angular/ejgrid#methods:selectrows

https://help.syncfusion.com/api/angular/ejgrid#events:rowdragstart

Regards,
Vignesh Natarajan

@ninopetrovic
Copy link
Author

Hello Vignesh,

Thank you! Your solution works for me.

Best regards,
Nino Petrovič

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants