angular2-draggable icon indicating copy to clipboard operation
angular2-draggable copied to clipboard

What if i want to persist the reorder in a list or in a div with different elements?

Open Mukazuge opened this issue 6 years ago • 2 comments

Currently, I'm using ng2-Dragula lib for this but I want to change it to your lib, in Dragula, we have something called Bags and we use that to rearrange a list or get back the elements order by simply using local storage to store that array. is there a way I can achieve this with Angular2-draggable? i know you have an input called position but it looks to me like this is useful in a div where someone wants to move an element with no preset position available (i mean with this, a table where I want to move a row from index 0 to 10)

TLDR: I want to persist the dragged elements position when I refresh my page, is this possible? if so is there a place where I can see a type of example?

Mukazuge avatar Feb 26 '19 02:02 Mukazuge

@Mukazuge If you want to persist the elements' position, you can use (endOffset) and [position]. But if you want to use a list, I'm afraid you need to make your own custom component.

xieziyu avatar Mar 01 '19 03:03 xieziyu

ooh, I see, so this lib is focused on elements with free space without preset order, nice. Thanks for the answer I´m sure i can use it in a different scenario in the future!

Mukazuge avatar Mar 01 '19 05:03 Mukazuge