Closed elineopsommer closed 6 years ago
Hello @elineopsommer, are you able to provide a plunkr? It would help me to quickly investigate.
I'm having a little bit progress, but still not enough.
Plunk made:
I'm sorry @elineopsommer, but I don't know what you are trying to achieve.
@Hypercubed In the plunkr you can see that you can drag & drop an item into a container so that you have 2 items on the same row, but you can't drag &drop an item above or below an item to reorder them. This needs to work. Also you can see that the model is not being updated so I can't question the current order of items.
@Hypercubed Is there any progress on this?
Make sure for every ngxDroppable
that has a [model]
(an array of items) all the children ngxDaggable
items also have a [model]
(the one item that relates to this draggable) and that this "model" object exists within the droppable model array. This is the only way ngx-dnd knows where in the droppable to fine the draggable. This also means that a single item cannot be both draggable and droppable since they both need a [model]
input.
Here is your fixed plunker: https://plnkr.co/edit/soDG7sRwBD1ZeAz2hpem?p=info
P.S. I know that it is frustrating when the code doesn't work, but in general GitHub issues are for reporting bugs, not support requests. There may be other venues that can provide more readily available support.
@Hypercubed the plunker you made seems to work on the same way as the plunk I provided. Also the model is not updated. Where can I ask for support for this?
@elineopsommer Darn, looks like the plunker didn't get saved correctly. I had to redo it... again, notice that the each droppable and draggable has a [model].
This seems to be pointed to as a sort of documentation by example issue, however this plunker does not work for me. Can the plunker be fixed, or is there some other way to host or view this example?
I'm submitting a ... (check one with "x")
Current behavior When you drag & drops an item into an item, everything is fine, also when you drags the dropped item back into the place which has no children, but when you drag & drops an item between two items, so not into an item, I get the following error
Unexpected token u in JSON at position 0
Sidenote: when I log '
orderableList
' into my controller, I get the originally list, not the one which is shown, how can I get this?Expected behavior Drag & drop items into an item + drag & drop item between items should behave correctly
Reproduction of the problem
What is the motivation / use case for changing the behavior? needs to drag an item and drop into it as well
Please tell us about your environment: OSX
Angular version: 5.1.1
Browser: [all]
Language: [ TypeScript 2.6.2 ]