In this episode, we take our Trello-style board up a notch by adding the ability to move cards not just within a column, but also between columns. First, we talk through the limitations of simply making the cards within a column sortable—because we want to drag them across columns, not just rearrange them locally.
To tackle this, we switch over to using sortable groups. This lets us treat each column as a group and allows our cards to be moved between them. We go step by step, setting up the wire:sortable-group
in our template and making sure each card and column has the right handlers and IDs in place.
There’s a bit of back-and-forth as we realize we need to specifically assign handlers to cards to allow them to be draggable without accidentally moving entire columns. Once that’s sorted, we try things out and see that we can now drag cards both within a column for reordering, and between columns for bigger moves. We inspect the resulting data to verify everything is in order.
By the end of the video, the groundwork for moving cards anywhere on our board is done, and all that's left is implementing the backend method to finish up the logic.