Author Topic: Not wanting delete from source grid with drag and drop  (Read 3031 times)

WynApse

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 17
    • View Profile
Not wanting delete from source grid with drag and drop
« on: November 27, 2019, 09:11:51 pm »
I've got the drop working as required, but the drag source is being removed.

Is there a setting that I can set somewhere to keep that from happening?

I have a need to drag the same source to multiple drop targets.

Thanks!

-Dave

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Not wanting delete from source grid with drag and drop
« Reply #1 on: November 28, 2019, 08:46:10 pm »
It's not feasible to drop single drag source to multiple drop locations.

WynApse

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Not wanting delete from source grid with drag and drop
« Reply #2 on: December 03, 2019, 02:37:44 am »
Just to be clear, I didn't mean a single drag to multiple drops. I meant more of a 'copy' drag where the source record is not removed rather than a 'cut-and-paste' drag where the source record is removed when dropped.

Is that clear?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Not wanting delete from source grid with drag and drop
« Reply #3 on: December 03, 2019, 07:45:15 pm »
Yes that makes sense. While it's not feasible to drag ( copy ) from single location and drop ( paste ) on multiple locations in one go, it's possible in multiple gestures.

I assume you need it for DnD between multilple grids.

Default implementation of dropModel.drop deletes rows from origin grid and adds the rows to destination grid.

You can implement your own dropModel.drop callback in which only add operation can be performed without deleting the rows from source grid.

Please take help of this API

dropModel.drop callback: https://paramquery.com/pro/api#option-dropModel

Add rows: https://paramquery.com/pro/api#method-addNodes